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

Fix CheckBox and CheckButton not using icon_max_width #91700

Merged
merged 1 commit into from
May 20, 2024

Conversation

sievaxx
Copy link
Contributor

@sievaxx sievaxx commented May 8, 2024

quick attempt. follows original rendering behavior in terms of where things are drawn if the other currently not drawn icons are larger.
fixes #91697

@sievaxx sievaxx changed the title make checkbox and checkbutton use max_icon_width Fix CheckBox and CheckButton not using max_icon_width May 8, 2024
@AThousandShips AThousandShips added this to the 4.3 milestone May 9, 2024
@sievaxx
Copy link
Contributor Author

sievaxx commented May 10, 2024

I don't think there's anything major i have to do, this seems like it's fine and everything else related to fitting the icons (e.g. different aspect ratios between all the state textures) seems to work the same as the old behavior (icons are drawn to the top left corner of the max size of all the icons), they're just now all able to be hard capped to a specific width.

I could add max_icon_width to the Checkbox and Checkbutton theme binds so they show up in theme overrides, but you can still add them manually to a theme resource and they inherit the settings of the button class, so dunno. This is only a minor usage (I was trying to make some UI look good at bigger render scales by scaling SVGs while importing and setting their icon width to the SVG's original size.).

@sievaxx sievaxx marked this pull request as ready for review May 10, 2024 16:48
@sievaxx sievaxx requested a review from a team as a code owner May 10, 2024 16:48
@KoBeWi
Copy link
Member

KoBeWi commented May 15, 2024

Might be worth documenting this in icon_max_width description. Something like "If the button has additional icons (e.g. [CheckBox]), they will also be limited."

@akien-mga akien-mga changed the title Fix CheckBox and CheckButton not using max_icon_width Fix CheckBox and CheckButton not using max_icon_width May 15, 2024
@akien-mga akien-mga changed the title Fix CheckBox and CheckButton not using max_icon_width Fix CheckBox and CheckButton not using icon_max_width May 20, 2024
@akien-mga akien-mga requested a review from a team as a code owner May 20, 2024 08:40
@akien-mga
Copy link
Member

Added KoBeWi's doc suggestion.

@akien-mga akien-mga merged commit 3bd2a6a into godotengine:master May 20, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

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.

Checkboxes and Checkbuttons do not respect icon_max_width
5 participants