1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Close #15660: Allow showing window buttons on the left (#20176)

This commit is contained in:
Michael Steenbeek
2023-05-19 10:17:38 +02:00
committed by GitHub
parent e1f7b240da
commit 5e495d63c7
53 changed files with 238 additions and 50 deletions

View File

@@ -15,6 +15,7 @@
#include <cmath>
#include <openrct2/Context.h>
#include <openrct2/Input.h>
#include <openrct2/config/Config.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Formatting.h>
@@ -565,11 +566,14 @@ static void WidgetCaptionDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex wid
int32_t width = widget->width() - 4;
if ((widget + 1)->type == WindowWidgetType::CloseBox)
{
width -= 10;
width -= CloseButtonWidth;
if ((widget + 2)->type == WindowWidgetType::CloseBox)
width -= 10;
width -= CloseButtonWidth;
}
topLeft.x += width / 2;
if (gConfigInterface.WindowButtonsOnTheLeft)
topLeft.x += CloseButtonWidth;
DrawTextEllipsised(
dpi, topLeft, width, widget->text, Formatter::Common(),
{ COLOUR_WHITE | static_cast<uint8_t>(COLOUR_FLAG_OUTLINE), TextAlignment::CENTRE });