MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / repositionCloseButton

Function repositionCloseButton

src/openrct2/interface/WindowBase.cpp:53–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51 }
52
53 static inline void repositionCloseButton(Widget& closeButton, int32_t windowWidth, bool translucent)
54 {
55 auto closeButtonSize = Config::Get().interface.enlargedUi ? kCloseButtonSizeTouch : kCloseButtonSize;
56 if (Config::Get().interface.windowButtonsOnTheLeft)
57 {
58 closeButton.left = 2;
59 closeButton.right = 2 + closeButtonSize;
60 }
61 else
62 {
63 closeButton.left = windowWidth - 3 - closeButtonSize;
64 closeButton.right = windowWidth - 3;
65 }
66
67 // Set appropriate close button
68 if (closeButtonSize == kCloseButtonSizeTouch)
69 closeButton.string = !translucent ? kCloseBoxStringBlackLarge : kCloseBoxStringWhiteLarge;
70 else
71 closeButton.string = !translucent ? kCloseBoxStringBlackNormal : kCloseBoxStringWhiteNormal;
72 }
73
74 void WindowBase::resizeFrame()
75 {

Callers 1

resizeFrameMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected