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 buttons offset to the right when dialog is at minsize #90852

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

timothyqiu
Copy link
Member

The command palette window at its minsize:

Before After
ksnip_20240418-212027 ksnip_20240418-212028

When determining window minimum width, panel padding should be applied after max(buttons_width, child_width).

godot/scene/gui/dialogs.cpp

Lines 223 to 227 in 2543d19

Size2 buttons_minsize = buttons_hbox->get_combined_minimum_size();
Size2 buttons_size = Size2(dlg_size.x - h_margins, buttons_minsize.y);
Point2 buttons_position = Point2(theme_cache.panel_style->get_margin(SIDE_LEFT), dlg_size.y - theme_cache.panel_style->get_margin(SIDE_BOTTOM) - buttons_size.y);
buttons_hbox->set_position(buttons_position);
buttons_hbox->set_size(buttons_size);

@timothyqiu timothyqiu added bug topic:gui cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release labels Apr 18, 2024
@timothyqiu timothyqiu requested a review from a team as a code owner April 18, 2024 13:23
@timothyqiu timothyqiu added this to the 4.3 milestone Apr 18, 2024
Copy link
Member

@kleonc kleonc left a comment

Choose a reason for hiding this comment

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

Makes sense!

@akien-mga akien-mga merged commit a523532 into godotengine:master Apr 19, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@timothyqiu timothyqiu deleted the padding-always branch April 19, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release topic:gui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants