From 7e049aa2b12601cf7467b80414177e72ee99f226 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 27 Mar 2024 09:02:42 +0000 Subject: [PATCH] Change: Use aspect ratio for common left/right buttons. --- src/widget.cpp | 4 ++++ src/window_gui.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/widget.cpp b/src/widget.cpp index eb965f78c2..46353c8f72 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -2559,9 +2559,13 @@ NWidgetLeaf::NWidgetLeaf(WidgetType tp, Colours colour, WidgetID index, uint32_t case WWT_MATRIX: case NWID_BUTTON_DROPDOWN: case NWID_PUSHBUTTON_DROPDOWN: + this->SetFill(0, 0); + break; + case WWT_ARROWBTN: case WWT_PUSHARROWBTN: this->SetFill(0, 0); + this->SetAspect(WidgetDimensions::ASPECT_LEFT_RIGHT_BUTTON); break; case WWT_EDITBOX: diff --git a/src/window_gui.h b/src/window_gui.h index 60bbf1a6b8..a18b9f85fb 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -71,6 +71,7 @@ public: static constexpr float ASPECT_RENAME = 12.f / 14.f; static constexpr float ASPECT_SETTINGS_BUTTON = 21.f / 12.f; static constexpr float ASPECT_TOGGLE_SIZE = 12.f / 14.f; + static constexpr float ASPECT_LEFT_RIGHT_BUTTON = 8.f / 12.f; static constexpr float ASPECT_UP_DOWN_BUTTON = 11.f / 12.f; static constexpr float ASPECT_VEHICLE_ICON = 15.f / 12.f; static constexpr float ASPECT_VEHICLE_FLAG = 11.f / 12.f;