From bc68828c7dd07ac51eff12e133156a2f31c43024 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Wed, 12 Aug 2026 17:10:44 +0200 Subject: [PATCH] Improve save field alignment in file browser window (#26916) * Improve save field alignment in file browser window * Adjust kButtonFaceHeight to match actual usage * Keep marketing campaign buttons overlapping The buttons themselves were already defined as 14px high, but now the constant has changed as well. --- src/openrct2-ui/windows/Finances.cpp | 4 ++-- src/openrct2-ui/windows/LoadSave.cpp | 12 ++++++------ src/openrct2/interface/Widget.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 542a4533c6..2f452be040 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -684,8 +684,8 @@ namespace OpenRCT2::Ui::Windows { campaignButton.setVisible(); campaignButton.top = y; - campaignButton.bottom = y + kButtonFaceHeight + 1; - y += kButtonFaceHeight + 2; + campaignButton.bottom = y + kButtonFaceHeight; + y += kButtonFaceHeight + 1; } else { diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index d9d2f36c28..b3ad219fce 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -692,15 +692,15 @@ namespace OpenRCT2::Ui::Windows if (action == LoadSaveAction::save) { - widgets[WIDX_SCROLL].bottom -= 18; + widgets[WIDX_SCROLL].bottom -= kButtonFaceHeight + 7; // Get 'Save' button string width auto saveLabel = LanguageGetString(STR_FILEBROWSER_SAVE_BUTTON); auto saveLabelWidth = getStringWidth(saveLabel, FontStyle::medium) + 12; widgets[WIDX_SAVE].setVisible(); - widgets[WIDX_SAVE].top = height - paddingBottom - 15; - widgets[WIDX_SAVE].bottom = height - paddingBottom - 3; + widgets[WIDX_SAVE].bottom = height - paddingBottom - 2; + widgets[WIDX_SAVE].top = widgets[WIDX_SAVE].bottom - kButtonFaceHeight; widgets[WIDX_SAVE].right = widgets[WIDX_SCROLL].right; widgets[WIDX_SAVE].left = widgets[WIDX_SAVE].right - saveLabelWidth; @@ -709,8 +709,8 @@ namespace OpenRCT2::Ui::Windows auto filenameLabelWidth = getStringWidth(filenameLabel, FontStyle::medium); widgets[WIDX_FILENAME_TEXTBOX].setVisible(); - widgets[WIDX_FILENAME_TEXTBOX].top = height - paddingBottom - 15; - widgets[WIDX_FILENAME_TEXTBOX].bottom = height - paddingBottom - 3; + widgets[WIDX_FILENAME_TEXTBOX].bottom = height - paddingBottom - 2; + widgets[WIDX_FILENAME_TEXTBOX].top = widgets[WIDX_FILENAME_TEXTBOX].bottom - kButtonFaceHeight; widgets[WIDX_FILENAME_TEXTBOX].left = 4 + filenameLabelWidth + 6; widgets[WIDX_FILENAME_TEXTBOX].right = widgets[WIDX_SAVE].left - 5; } @@ -778,7 +778,7 @@ namespace OpenRCT2::Ui::Windows if (action == LoadSaveAction::save) { auto& widget = widgets[WIDX_FILENAME_TEXTBOX]; - drawText(rt, windowPos + ScreenCoordsXY{ 5, widget.top + 2 }, STR_FILENAME_LABEL, { Drawing::Colour::grey }); + drawText(rt, windowPos + ScreenCoordsXY{ 5, widget.top + 1 }, STR_FILENAME_LABEL, { Drawing::Colour::grey }); } } diff --git a/src/openrct2/interface/Widget.h b/src/openrct2/interface/Widget.h index b46499e399..02fd36e302 100644 --- a/src/openrct2/interface/Widget.h +++ b/src/openrct2/interface/Widget.h @@ -220,7 +220,7 @@ namespace OpenRCT2 constexpr int32_t kScrollableRowHeight = 12; constexpr uint8_t kListRowHeight = 12; constexpr uint8_t kTableCellHeight = 12; - constexpr uint8_t kButtonFaceHeight = 12; + constexpr uint8_t kButtonFaceHeight = 14; constexpr uint8_t kSpinnerHeight = 14; constexpr uint8_t kDropdownHeight = 14;