diff --git a/src/openrct2-ui/windows/AssetPacks.cpp b/src/openrct2-ui/windows/AssetPacks.cpp index 89051e9a88..442fb134dd 100644 --- a/src/openrct2-ui/windows/AssetPacks.cpp +++ b/src/openrct2-ui/windows/AssetPacks.cpp @@ -148,11 +148,7 @@ public: void OnPrepareDraw() override { - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; + ResizeFrame(); auto& list = widgets[WIDX_LIST]; list.left = 6; diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 1a70012ed2..0ca1c60a4d 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -147,13 +147,7 @@ public: void OnPrepareDraw() override { - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; - widgets[WIDX_CONTENT_PANEL].right = width - 1; - widgets[WIDX_CONTENT_PANEL].bottom = height - 1; + ResizeFrameWithPage(); widgets[WIDX_SCROLL].right = width - 3; widgets[WIDX_SCROLL].bottom = height - 22; widgets[WIDX_OPEN_URL].bottom = height - 5; diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 728c571356..6b6ea56798 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -442,13 +442,7 @@ public: widgets[WIDX_CLOSE].type = gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR ? WindowWidgetType::Empty : WindowWidgetType::CloseBox; - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; - widgets[WIDX_RESIZE].right = width - 1; - widgets[WIDX_RESIZE].bottom = height - 1; + ResizeFrameWithPage(); int16_t scrollListHeight = (height - 88) / 2; diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index ea7381c9e7..034754e732 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -815,13 +815,7 @@ public: void OnPrepareDraw() override { // Resize widgets - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; - widgets[WIDX_TAB_CONTENT_PANEL].right = width - 1; - widgets[WIDX_TAB_CONTENT_PANEL].bottom = height - 1; + ResizeFrameWithPage(); widgets[WIDX_ADVANCED].left = width - 130; widgets[WIDX_ADVANCED].right = width - 9; widgets[WIDX_LIST].right = width - 309; diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 01820e86f0..4766f79eeb 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -225,13 +225,7 @@ static void WindowEditorObjectiveOptionsSetPressedTab(rct_window* w) static void WindowEditorObjectiveOptionsAnchorBorderWidgets(rct_window* w) { - w->widgets[WIDX_BACKGROUND].right = w->width - 1; - w->widgets[WIDX_BACKGROUND].bottom = w->height - 1; - w->widgets[WIDX_PAGE_BACKGROUND].right = w->width - 1; - w->widgets[WIDX_PAGE_BACKGROUND].bottom = w->height - 1; - w->widgets[WIDX_TITLE].right = w->width - 2; - w->widgets[WIDX_CLOSE].left = w->width - 13; - w->widgets[WIDX_CLOSE].right = w->width - 3; + w->ResizeFrameWithPage(); } static void WindowEditorObjectiveOptionsDrawTabImages(rct_window* w, rct_drawpixelinfo* dpi) diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index e93c8f3bf5..6fd2100fae 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -317,13 +317,7 @@ private: void AnchorBorderWidgets() { - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_PAGE_BACKGROUND].right = width - 1; - widgets[WIDX_PAGE_BACKGROUND].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; + ResizeFrameWithPage(); } void DrawTabImages(rct_drawpixelinfo& dpi) diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 3deb06ebd2..0c73615375 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -440,13 +440,7 @@ private: auto ft = Formatter::Common(); peep->FormatNameTo(ft); - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_PAGE_BACKGROUND].right = width - 1; - widgets[WIDX_PAGE_BACKGROUND].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; + ResizeFrameWithPage(); window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7); } diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 95b747ce34..628125c1aa 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -414,13 +414,7 @@ public: if (_selectedTab == TabId::Individual && _selectedFilter) widgets[WIDX_MAP].type = WindowWidgetType::FlatBtn; - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_TAB_CONTENT_PANEL].right = width - 1; - widgets[WIDX_TAB_CONTENT_PANEL].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; + ResizeFrameWithPage(); widgets[WIDX_GUEST_LIST].right = width - 4; widgets[WIDX_GUEST_LIST].bottom = height - 15; widgets[WIDX_MAP].left = 273 - 350 + width; diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 68bea5c9fa..091017102a 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -654,16 +654,7 @@ static void WindowLoadsaveComputeMaxDateWidth() static void WindowLoadsaveInvalidate(rct_window* w) { - window_loadsave_widgets[WIDX_TITLE].right = w->width - 2; - // close button has to move if it's on the right side - window_loadsave_widgets[WIDX_CLOSE].left = w->width - 13; - window_loadsave_widgets[WIDX_CLOSE].right = w->width - 3; - - window_loadsave_widgets[WIDX_BACKGROUND].right = w->width - 1; - window_loadsave_widgets[WIDX_BACKGROUND].bottom = w->height - 1; - window_loadsave_widgets[WIDX_RESIZE].top = w->height - 1; - window_loadsave_widgets[WIDX_RESIZE].right = w->width - 1; - window_loadsave_widgets[WIDX_RESIZE].bottom = w->height - 1; + w->ResizeFrameWithPage(); rct_widget* date_widget = &window_loadsave_widgets[WIDX_SORT_DATE]; date_widget->right = w->width - 5; diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 376956c8d8..2d905e8d6b 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -752,13 +752,7 @@ public: SetWidgetDisabled(WIDX_MAP_SIZE_LINK, gMapSize.x != gMapSize.y); // Resize widgets to window size - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_RESIZE].right = width - 1; - widgets[WIDX_RESIZE].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].left = width - 2 - 11; - widgets[WIDX_CLOSE].right = width - 2 - 11 + 10; + ResizeFrameWithPage(); widgets[WIDX_MAP].right = width - 4; if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index f8f718c3e6..67ce26f6bf 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -266,13 +266,7 @@ static void WindowMultiplayerSetPage(rct_window* w, int32_t page) static void WindowMultiplayerAnchorBorderWidgets(rct_window* w) { - w->widgets[WIDX_BACKGROUND].right = w->width - 1; - w->widgets[WIDX_BACKGROUND].bottom = w->height - 1; - w->widgets[WIDX_TITLE].right = w->width - 2; - w->widgets[WIDX_CONTENT_PANEL].right = w->width - 1; - w->widgets[WIDX_CONTENT_PANEL].bottom = w->height - 1; - w->widgets[WIDX_CLOSE].left = w->width - 13; - w->widgets[WIDX_CLOSE].right = w->width - 3; + w->ResizeFrameWithPage(); } static void WindowMultiplayerSetPressedTab(rct_window* w) diff --git a/src/openrct2-ui/windows/NetworkStatus.cpp b/src/openrct2-ui/windows/NetworkStatus.cpp index 9ff0452a78..69d5ef63a4 100644 --- a/src/openrct2-ui/windows/NetworkStatus.cpp +++ b/src/openrct2-ui/windows/NetworkStatus.cpp @@ -94,11 +94,7 @@ public: void OnPrepareDraw() override { - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].left = width - 2 - 0x0B; - widgets[WIDX_CLOSE].right = width - 2 - 0x0B + 0x0A; + ResizeFrame(); } void OnDraw(rct_drawpixelinfo& dpi) override diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 3a4c274fd2..1684842a62 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -762,18 +762,12 @@ private: Invalidate(); // Resize widgets to new window size - widgets[WIDX_BACKGROUND].right = newWidth - 1; - widgets[WIDX_BACKGROUND].bottom = newHeight - 1; - widgets[WIDX_PAGE_BACKGROUND].right = newWidth - 1; - widgets[WIDX_PAGE_BACKGROUND].bottom = newHeight - 1; - widgets[WIDX_TITLE].right = newWidth - 2; - widgets[WIDX_CLOSE].left = newWidth - 13; - widgets[WIDX_CLOSE].right = newWidth - 3; + width = newWidth; + height = newHeight; + ResizeFrameWithPage(); widgets[WIDX_GROUP_BY_TRACK_TYPE].left = newWidth - 8 - GroupByTrackTypeWidth; widgets[WIDX_GROUP_BY_TRACK_TYPE].right = newWidth - 8; - width = newWidth; - height = newHeight; Invalidate(); } diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 45e99711f4..9e378289e3 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -1202,13 +1202,7 @@ private: void AnchorBorderWidgets() { - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_PAGE_BACKGROUND].right = width - 1; - widgets[WIDX_PAGE_BACKGROUND].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; + ResizeFrameWithPage(); } void SetPressedTab() diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index 9b793230a4..a5c76bc83d 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -379,13 +379,7 @@ void WindowPlayerOverviewInvalidate(rct_window* w) WindowPlayerUpdateTitle(w); - w->widgets[WIDX_BACKGROUND].right = w->width - 1; - w->widgets[WIDX_BACKGROUND].bottom = w->height - 1; - w->widgets[WIDX_PAGE_BACKGROUND].right = w->width - 1; - w->widgets[WIDX_PAGE_BACKGROUND].bottom = w->height - 1; - w->widgets[WIDX_TITLE].right = w->width - 2; - w->widgets[WIDX_CLOSE].left = w->width - 13; - w->widgets[WIDX_CLOSE].right = w->width - 3; + w->ResizeFrameWithPage(); w->widgets[WIDX_LOCATE].right = w->width - 2; w->widgets[WIDX_LOCATE].left = w->width - 25; w->widgets[WIDX_KICK].right = w->width - 2; @@ -472,13 +466,7 @@ void WindowPlayerStatisticsInvalidate(rct_window* w) WindowPlayerUpdateTitle(w); - w->widgets[WIDX_BACKGROUND].right = w->width - 1; - w->widgets[WIDX_BACKGROUND].bottom = w->height - 1; - w->widgets[WIDX_PAGE_BACKGROUND].right = w->width - 1; - w->widgets[WIDX_PAGE_BACKGROUND].bottom = w->height - 1; - w->widgets[WIDX_TITLE].right = w->width - 2; - w->widgets[WIDX_CLOSE].left = w->width - 13; - w->widgets[WIDX_CLOSE].right = w->width - 3; + w->ResizeFrameWithPage(); window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_2); } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 677ec2fd43..fa2b5d77d8 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1468,13 +1468,7 @@ static void WindowRideSetPressedTab(rct_window* w) static void WindowRideAnchorBorderWidgets(rct_window* w) { - w->widgets[WIDX_BACKGROUND].right = w->width - 1; - w->widgets[WIDX_BACKGROUND].bottom = w->height - 1; - w->widgets[WIDX_PAGE_BACKGROUND].right = w->width - 1; - w->widgets[WIDX_PAGE_BACKGROUND].bottom = w->height - 1; - w->widgets[WIDX_TITLE].right = w->width - 2; - w->widgets[WIDX_CLOSE].left = w->width - 13; - w->widgets[WIDX_CLOSE].right = w->width - 3; + w->ResizeFrameWithPage(); } #pragma region Main diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 05a6d57d2b..4d2db46c5f 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -450,15 +450,7 @@ public: else pressed_widgets &= ~(1uLL << WIDX_QUICK_DEMOLISH); - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_PAGE_BACKGROUND].right = width - 1; - widgets[WIDX_PAGE_BACKGROUND].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - - // if close button is on the right then it must move - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; + ResizeFrameWithPage(); widgets[WIDX_LIST].right = width - 26; widgets[WIDX_LIST].bottom = height - 15; diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 4e52bfd933..779c7f25ab 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -412,20 +412,11 @@ static void WindowScenarioselectInvalidate(rct_window* w) w->pressed_widgets |= 1LL << (w->selected_tab + WIDX_TAB1); - int32_t windowWidth = w->width; - window_scenarioselect_widgets[WIDX_BACKGROUND].right = windowWidth - 1; - window_scenarioselect_widgets[WIDX_TITLEBAR].right = windowWidth - 2; - window_scenarioselect_widgets[WIDX_CLOSE].left = windowWidth - 13; - window_scenarioselect_widgets[WIDX_CLOSE].right = windowWidth - 3; - window_scenarioselect_widgets[WIDX_TABCONTENT].right = windowWidth - 1; - window_scenarioselect_widgets[WIDX_SCENARIOLIST].right = windowWidth - 179; - - int32_t windowHeight = w->height; - window_scenarioselect_widgets[WIDX_BACKGROUND].bottom = windowHeight - 1; - window_scenarioselect_widgets[WIDX_TABCONTENT].bottom = windowHeight - 1; + w->ResizeFrameWithPage(); const int32_t bottomMargin = gConfigGeneral.DebuggingTools ? 17 : 5; - window_scenarioselect_widgets[WIDX_SCENARIOLIST].bottom = windowHeight - bottomMargin; + window_scenarioselect_widgets[WIDX_SCENARIOLIST].right = w->width - 179; + window_scenarioselect_widgets[WIDX_SCENARIOLIST].bottom = w->height - bottomMargin; } static void WindowScenarioselectPaint(rct_window* w, rct_drawpixelinfo* dpi) diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index a36320720c..2c0c9fb72b 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -352,11 +352,7 @@ static OpenRCT2String WindowServerListTooltip(rct_window* const w, const WidgetI static void WindowServerListInvalidate(rct_window* w) { - window_server_list_widgets[WIDX_BACKGROUND].right = w->width - 1; - window_server_list_widgets[WIDX_BACKGROUND].bottom = w->height - 1; - window_server_list_widgets[WIDX_TITLE].right = w->width - 2; - window_server_list_widgets[WIDX_CLOSE].left = w->width - 2 - 11; - window_server_list_widgets[WIDX_CLOSE].right = w->width - 2 - 11 + 10; + w->ResizeFrame(); int32_t margin = 6; int32_t buttonHeight = 13; diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index 10bd97b1a0..9fa5a71bd6 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -234,13 +234,7 @@ public: void OnPrepareDraw() override { - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].right = width - 3; - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_TAB_CONTENT_PANEL].right = width - 1; - widgets[WIDX_TAB_CONTENT_PANEL].bottom = height - 1; + ResizeFrameWithPage(); widgets[WIDX_SCROLL].right = width - 5; widgets[WIDX_SCROLL].bottom = height - 19; widgets[WIDX_RESET].top = height - 16; diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 6b1fd077fe..159450aec8 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -339,16 +339,7 @@ private: auto ft = Formatter::Common(); staff->FormatNameTo(ft); - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - - widgets[WIDX_RESIZE].right = width - 1; - widgets[WIDX_RESIZE].bottom = height - 1; - - widgets[WIDX_TITLE].right = width - 2; - - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; + ResizeFrameWithPage(); } void CommonPrepareDrawAfter() diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index ebf34ce325..891f15beeb 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -177,13 +177,7 @@ public: { rct_widget* viewportWidget = &window_viewport_widgets[WIDX_VIEWPORT]; - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; - widgets[WIDX_CONTENT_PANEL].right = width - 1; - widgets[WIDX_CONTENT_PANEL].bottom = height - 1; + ResizeFrameWithPage(); widgets[WIDX_ZOOM_IN].left = width - 27; widgets[WIDX_ZOOM_IN].right = width - 2; widgets[WIDX_ZOOM_OUT].left = width - 27; diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 01bf1f4e01..408d4ff284 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -2238,3 +2238,23 @@ void WidgetScrollUpdateThumbs(rct_window& w, WidgetIndex widget_index) } } } + +void rct_window::ResizeFrame() +{ + // Frame + widgets[0].right = width - 1; + widgets[0].bottom = height - 1; + // Title + widgets[1].right = width - 2; + // Close button + widgets[2].left = width - 13; + widgets[2].right = width - 3; +} + +void rct_window::ResizeFrameWithPage() +{ + ResizeFrame(); + // Page background + widgets[3].right = width - 1; + widgets[3].bottom = height - 1; +} diff --git a/src/openrct2/interface/Window_internal.h b/src/openrct2/interface/Window_internal.h index 4e0b1f2732..fec402e149 100644 --- a/src/openrct2/interface/Window_internal.h +++ b/src/openrct2/interface/Window_internal.h @@ -197,6 +197,9 @@ struct rct_window virtual void OnUnknown5() { } + + void ResizeFrame(); + void ResizeFrameWithPage(); }; #ifdef __WARN_SUGGEST_FINAL_METHODS__