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

Add minimum width/height to dialog buttons #89693

Merged

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Mar 19, 2024

This makes buttons with short texts such as "OK" or "Close" easier to click, especially on a touchscreen.

This is exposed to projects via buttons_min_width and buttons_min_height theme items in AcceptDialog (and therefore ConfirmationDialog and FileDialog), with the default values being 0 to preserve compatibility with existing projects.

Preview

AcceptDialog

Before
acceptdialog_before
Default Compact Spacious
Default Compact Spacious

ConfirmationDialog

Before
confirmationdialog_before
Default Compact Spacious
Default Compact Spacious

Copy link
Contributor

@passivestar passivestar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good 👍

image

image

Unrelated: most dialog windows in godot are missing paddings

@Calinou
Copy link
Member Author

Calinou commented Mar 20, 2024

Unrelated: most dialog windows in godot are missing paddings

See #89718.

@kleonc
Copy link
Member

kleonc commented Mar 20, 2024

This doesn't play well with the interface/theme/spacing_preset editor setting (added in #87085). At least for the "Compact" preset it feels to not fit in.

@Calinou Calinou force-pushed the dialogs-add-button-minimum-size branch from 6d5bd83 to e8422b8 Compare March 21, 2024 00:16
@Calinou
Copy link
Member Author

Calinou commented Mar 21, 2024

This doesn't play well with the interface/theme/spacing_preset editor setting (added in #87085). At least for the "Compact" preset it feels to not fit in.

I've pushed an update that adjusts padding based on the spacing preset. Spacing with the Default preset was also reduced by a few pixels on both axes. See OP for updated screenshots.

@kleonc
Copy link
Member

kleonc commented Mar 21, 2024

I've pushed an update that adjusts padding based on the spacing preset. Spacing with the Default preset was also reduced by a few pixels on both axes. See OP for updated screenshots.

Way better now!
To me they still look big in the "Compact" preset but I guess that's the point of this PR. So should be fine as is. 🙂

You also need to add docs for the added theme properties.

@Calinou Calinou force-pushed the dialogs-add-button-minimum-size branch from e8422b8 to c14ba32 Compare March 22, 2024 17:32
@Calinou Calinou requested a review from a team as a code owner March 22, 2024 17:32
This makes buttons with short texts such as "OK" or "Close"
easier to click, especially on a touchscreen.

This is exposed to projects via `buttons_min_width` and `buttons_min_height`
theme items in AcceptDialog (and therefore ConfirmationDialog and FileDialog),
with the default values being 0 to preserve compatibility with existing projects.
@Calinou Calinou force-pushed the dialogs-add-button-minimum-size branch from c14ba32 to 1e85266 Compare April 17, 2024 21:48
@Calinou
Copy link
Member Author

Calinou commented Apr 17, 2024

You also need to add docs for the added theme properties.

Done.

@akien-mga akien-mga modified the milestones: 4.x, 4.3 Apr 18, 2024
@akien-mga akien-mga merged commit 0dfb48e into godotengine:master Apr 18, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@Calinou Calinou deleted the dialogs-add-button-minimum-size branch April 18, 2024 14:49
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.

4 participants