Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overload set_visibility for Panel2D and Combobox2D #768

Merged
merged 2 commits into from
Jun 12, 2023

Conversation

dwijrajhari
Copy link
Contributor

@dwijrajhari dwijrajhari commented Mar 20, 2023

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?

Copy link
Contributor

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dwijrajhari,

Thank you for the description. Can you add tests for this additional function. Thanks !

@dwijrajhari
Copy link
Contributor Author

@skoudoro Added test. Kindly review

@ganimtron-10
Copy link
Contributor

@dwijrajhari can you rebase this PR so that we can review it?

@skoudoro
This looks a good solution for the issue #562 #731

@ganimtron-10
Copy link
Contributor

@skoudoro Please have a look at this PR!

@skoudoro
Copy link
Contributor

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 #731 using master branch.

@skoudoro
Copy link
Contributor

Ok, I looked deeper, I see what you are doing.

@skoudoro skoudoro linked an issue Jun 12, 2023 that may be closed by this pull request
Copy link
Contributor

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, we might need to review the actor visibility design choice. It should be part of the UI future redesign.

For now, this solution looks good to me and thank you for doing this @dwijrajhari.

Thanks for the review @ganimtron-10.

Merging

@skoudoro skoudoro merged commit c2e5151 into fury-gl:master Jun 12, 2023
@dwijrajhari dwijrajhari deleted the duplicate-callbacks branch July 9, 2023 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clicking the tab of a ComboBox2D opens dropdown without changing icon drop_down_menu icon flaw in ComboBox2D
3 participants