-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
PopupMenu rework and enhancements. #41640
PopupMenu rework and enhancements. #41640
Conversation
Would be cool if you added hysteresis too 🙃 |
@KoBeWi That's a good feature, I'll see if I can add it in this PR. I did a search for PopupMenu issues and that one didnt come up :P |
It looks great ! :) I'll have a look to the code. |
@KoBeWi I have made some progress on adding that, but if I complete it fully I will put it in a separate PR so it can be reviewed separately from this PR, and not too many features/changes get muddled up in one PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me, but i haven't tested locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yeah it looks like the height of the contents is calculated with an extra very small value, so the contents has to scroll a tiny bit. Will investigate in the morning |
Looks like there are a number of issues to resolve...
|
53dc3e1
to
840e145
Compare
@KoBeWi ok, all done. I found some more stuff as in my previous comment which is now resolved. The issue you found was really weird... It seems like the setting of the margin was not occurring properly on the margin container. So, the margins were 10px, but the content thought it was only 8px (which is what it should be). Therefore there was a 4px scroll (10px*2 - 8px*2). Anyway, moving the setting of the margins away from notification enter tree is what worked. @groud if you care to re-review, the changes of the most recent commit (which were squashed into one) were:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine now after brief testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! I've just commented on some details.
I can also confirm the latest changes fix #41564.
Many scrolling behaviour improvements and the ability to limit popup size.
840e145
to
73c7fb2
Compare
Thanks! Amazing work :) |
Awesome, thanks a lot ! |
…pupMenu rework
Updated PopupMenu documentation after merge of #41640 - PopupMenu rework
…pupMenu rework
will this be backported to the v3 branch? |
Is this obselete? |
This pull request was merged in the It may be possibly to selectively backport features from this PR to |
I'm interested in backporting these changes, but what are the mentioned "breaking changes"? And what features should I avoid backporting? |
I'm not too sure. @Calinou is it breaking change because of the fact that it changes the way the popup looks/behaves? I don't think there was any breaking api changes by looking at the code. If you like, you can try backporting it and see how you go. Working through it will probably make any breaking changes more obvious. |
Initially inspired by this reddit post, which never got it's own issue submitted. This PR resolves a few existing issues with PopupMenu's which did have issue tickets, but also a few others which I found when making this PR.
get_popup()->set_max_size()
(in C++) orget_popup().max_size
(in GDScript). Of course, this works both in editor and in projects.Item
struct.Bugsquad edit: Also fixes #41564.