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

Tree Don't consume mouse event by collapse arrow which isn't shown #55791

Conversation

kleonc
Copy link
Member

@kleonc kleonc commented Dec 10, 2021

Collapse/folding arrow is shown only when TreeItem has children (has the first child) and it should handle a mouse event only if it's actually visible.

@KoBeWi
Copy link
Member

KoBeWi commented Dec 24, 2021

It is some improvement, but what exactly does this change? I don't see any difference in behavior.

@kleonc
Copy link
Member Author

kleonc commented Dec 24, 2021

It is some improvement, but what exactly does this change?

It makes mouse events not being handled/consumed by an invisible collapse/folding arrow.

I don't see any difference in behavior.

For reference: I've noticed this wrong behavior because of #55774 (I'm mentioning this PR in #55774 (comment)).
For example open Editor -> Manage Editor Features... dialog. Currently for tree items with no children checkboxes can be toggled by clicking on the left from the invisible collapse arrow (you can test it yourself) but not by clicking over that invisible arrow (because it handles the event):
6yT48NIo82
E9kH1Tq9WE
But if the checkbox (or anything else) is supposed to handle mouse event on the left then the invisible arrow shouldn't block it. And that's what this PR is fixing. With this PR:

Xze6EpUjkN

And this PR isn't really about the checkboxes and whether it makes sense to toggle them by clicking to the left from them (that's what #55774 is about). It's just an example. An invisible collapse/fold arrow shouldn't handle/consume mouse event over it no matter (as it's kinda nonexistent) what and that's what this PR is fixing.

@akien-mga akien-mga merged commit 319c442 into godotengine:master Jan 5, 2022
@akien-mga
Copy link
Member

Thanks!

@kleonc kleonc deleted the tree-dont-consume-mouse-if-collapser-not-visible branch February 1, 2022 11:54
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.

4 participants