Closed dwijrajhari closed 1 year ago
@skoudoro Added test. Kindly review
@dwijrajhari can you rebase this PR so that we can review it?
@skoudoro This looks a good solution for the issue #562 #731
@skoudoro Please have a look at this PR!
Hi @ganimtron-10 and @dwijrajhari,
I think the fix can be even simpler than that. Actually, I do not succeed to reproduce the issue on the main branch.
I agree that the arrow do not start on the right position but after 2 clicks, all is good. it look like an initialization issue and not set_visibility
issue. I am not 100% sure.
So I recommend to test https://github.com/fury-gl/fury/issues/731 using master branch.
Ok, I looked deeper, I see what you are doing.
Related issue: #731 (Clicking the tab of a ComboBox2D opens dropdown without changing icon)
Currently, the way set_visibility is implemented, it collects a list of all the actors down the tree and sets visibility of all of them. Thus the child elements of, say a Panel2D, don't get to choose which actors of themselves they want to make visible. Thus when a TabPanel2D containing a comboBox2D is selected, it sets the visibility of the comboBox's drop_down_menu to true, even though its _menu_visibility is set to false.
Possible fix: We overload the set_visibility method of Panel2D to call set_visibility on all of its elements. We then overload the set_visibility of comboBox2D to only make the dropdown visible if _menu_visibility is true
This change fixes #731 and also passes existing tests in
fury\ui\tests
However, since I am not fully aware of the codebase, I don't know if there was a particular reason, set_visiblility was implemented that way. @skoudoro Could you give me some hints?