-
-
Notifications
You must be signed in to change notification settings - Fork 21.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
Update size or size cache when toggling expand_icon
in Button
#75958
Update size or size cache when toggling expand_icon
in Button
#75958
Conversation
052d0b5
to
21406a4
Compare
Feels a little hackish to just bring |
When the properties of the parent class change, the way to notify the subclass, here all I can think of is a callback function or a signal. Maybe there's a better way than either of these. But it feels unnecessary to use a signal for this property change alone. |
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.
It's hacky, but I can't really think of a better solution (we could make set_expand_icon()
virtual, but it's meh). Maybe we could rename the method to something more generic, like _expand_icon_toggled()
, but the current name is fine.
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, it's hacky, but pretty minor. Can you please rename the method though, so its purpose clear? _queue_update_size_cache
should do the trick.
When the `expand_icon` is switched, the size cache can be updated to solve the issue that the cache cannot be updated when the `OptionButton` is enabled with `fit_to_longest_item`.
21406a4
to
9bd1d3b
Compare
OK, renaming is done. |
Thanks! |
When the
expand_icon
is switched, the size cache can be updated to solve the issue that the cache cannot be updated when theOptionButton
is enabled withfit_to_longest_item
.Fix #68930. Combining with #64351 may work even better.