-
-
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
Fix the expand icon calculation logic to the function Button::get_minimum_size #59340
Fix the expand icon calculation logic to the function Button::get_minimum_size #59340
Conversation
Maybe you should explain what this PR does in details and how it works (for example by providing some video to show)? |
Is this fixing an existing issue? #59202 Perhaps? You can indicate that a PR will close a certain issue by writing, for example.
There are a number of these keywords, see here: https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue Explaining a bit about what you did in the PR and perhaps an image or GIF showing the fixed behaviour also goes a long way, as Chaosus said. |
Probably one of the recorders listed in here: https://itsfoss.com/best-gif-recorder-linux. On Windows (which I'm using), the |
Thanks, I will try it. |
Thanks again to @Chaosus for the recommended tool, peek. Now it behaves like in the GIF image above. |
9a2049a
to
0648399
Compare
Now, it fixes #59202 by adding a callback method. The method will return the width caused by the properties beside those in Button. Edited: I found that there is a property |
858dc89
to
8d790fd
Compare
8d790fd
to
1ba78ba
Compare
Take the theme property theme_override_constants/arrow_margin into account when calculating the minimum size. Use the actual size, suitable for asymmetric. Add a function to get the width of the extra properties, which may affect the width of the size. Fixes godotengine#59202
1ba78ba
to
4d54446
Compare
Superseded by #64351. |
Fix the expand icon calculation logic which belongs to the function
Button::get_minimum_size
If enable the
expand_icon
, the icon may be hidden when the width of the button is not wide enough. This is where I mainly want to fix in this patch.Note:
The last thing worth noting is that the minimum achievable scale size is highly correlated with the font size, even if the text is empty. So, if you want a small texture size, you need to make the font size small enough. I'm not sure the specific design requirements, just adjusted some logic.
Should we make the texture keep aspect, or follow other rules?
Other matters
I'm glad it partially resolves #59202, but if the height of the button is too large, it will still appear.I checked the source code of
OptionButton
, it overrides this method, maybe this problem needs to be fixed there. It is very likely that this propertytheme_override_constants/arrow_margin
was not considered.