From 347862504f2d8039d9f98d9da021e578eaad270c Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 5 Feb 2024 17:10:31 +0000 Subject: [PATCH] Fix rail toolbar layout when polyrail button hidden at init --- src/rail_gui.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 6a28aae601..d2428cc261 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -509,13 +509,14 @@ struct BuildRailToolbarWindow : Window { BuildRailToolbarWindow(WindowDesc *desc, RailType railtype) : Window(desc) { - this->InitNested(TRANSPORT_RAIL); - this->SetupRailToolbar(railtype); - this->DisableWidget(WID_RAT_REMOVE); - this->last_user_action = INVALID_WID_RAT; + this->CreateNestedTree(); if (!_settings_client.gui.show_rail_polyline_tool) { this->GetWidget(WID_RAT_POLYRAIL_SEL)->SetDisplayedPlane(SZSP_NONE); } + this->FinishInitNested(TRANSPORT_RAIL); + this->SetupRailToolbar(railtype); + this->DisableWidget(WID_RAT_REMOVE); + this->last_user_action = INVALID_WID_RAT; if (_settings_client.gui.link_terraform_toolbar) ShowTerraformToolbar(this); }