-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix bugs in popup #10573
Fix bugs in popup #10573
Conversation
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.
I found a typo but otherwise this looks good. I've been using it locally since you posted it
(I will rebase later to absorb that commit sp we don't have to Squash merge) |
Co-authored-by: ath3 <ha05190@protonmail.com>
Trunctation should always be handled by the parent. Returning None is only supposed to indicate a missing implementation Co-authored-by: Ben Fekih, Hichem" <hichem.f@live.de>
Co-authored-by: Ben Fekih, Hichem" <hichem.f@live.de>
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.
Nice, not only did you fix it, but you also refactored it and eliminated a bunch of repetition too. Thanks and nice work!
if PADDING >= viewport.1 || PADDING >= viewport.0 { | ||
return None; | ||
} |
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.
Was this the bug? Returning None
instead of a default size?
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.
Yeah this was an existing bug that caused crashes. required_size is only meant to always return None (for components that can't be embedded in a popup) or always meant to return Some. The API is a bit confusing and was very inconsistently used so this seems to have slipped trough at some point.
fixes #10569
this fixes regression introduced by #10257 both regarding general crashes and bugs when popup borders are used (#10566/#10553). While working on this I noticed there were actually existing bugs where the border size wasn't quite taken into account while scrolling which I also fixed. Since borders now need to be accounted for in the popup I made the border config and entirely internal config so its moore self contained.
Also incorporated the fixes from #10507 with some slight adjustments.
Marked for the next release since this fixes newly introduced crashes that are fairly easy to trigger