mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-19 04:53:12 +01:00
Merge pull request #24288 from AaronVanGeffen/close-buttons
Generalise white close button strings to all translucent title bars
This commit is contained in:
@@ -49,7 +49,7 @@ namespace OpenRCT2
|
||||
return CursorID::Arrow;
|
||||
}
|
||||
|
||||
static inline void repositionCloseButton(Widget& closeButton, int32_t windowWidth)
|
||||
static inline void repositionCloseButton(Widget& closeButton, int32_t windowWidth, bool translucent)
|
||||
{
|
||||
auto closeButtonSize = Config::Get().interface.EnlargedUi ? kCloseButtonSizeTouch : kCloseButtonSize;
|
||||
if (Config::Get().interface.WindowButtonsOnTheLeft)
|
||||
@@ -64,11 +64,10 @@ namespace OpenRCT2
|
||||
}
|
||||
|
||||
// Set appropriate close button
|
||||
bool useWhite = closeButton.string == kCloseBoxStringWhiteLarge || closeButton.string == kCloseBoxStringWhiteNormal;
|
||||
if (closeButtonSize == kCloseButtonSizeTouch)
|
||||
closeButton.string = !useWhite ? kCloseBoxStringBlackLarge : kCloseBoxStringWhiteLarge;
|
||||
closeButton.string = !translucent ? kCloseBoxStringBlackLarge : kCloseBoxStringWhiteLarge;
|
||||
else
|
||||
closeButton.string = !useWhite ? kCloseBoxStringBlackNormal : kCloseBoxStringWhiteNormal;
|
||||
closeButton.string = !translucent ? kCloseBoxStringBlackNormal : kCloseBoxStringWhiteNormal;
|
||||
}
|
||||
|
||||
void WindowBase::ResizeFrame()
|
||||
@@ -93,7 +92,10 @@ namespace OpenRCT2
|
||||
// Close button
|
||||
auto& closeButton = widgets[2];
|
||||
if (closeButton.type == WindowWidgetType::CloseBox || closeButton.type == WindowWidgetType::Empty)
|
||||
repositionCloseButton(closeButton, width);
|
||||
{
|
||||
bool translucent = colours[closeButton.colour].hasFlag(ColourFlag::translucent);
|
||||
repositionCloseButton(closeButton, width, translucent);
|
||||
}
|
||||
|
||||
// Page/resize widget
|
||||
if (widgets.size() >= 4)
|
||||
|
||||
Reference in New Issue
Block a user