Codefix: [UI] Incorrect initialisation order for rail/road toolbars. (#12843)

The toolbar state was set after the widget tree is created, during which toolbar state is needed.
master
Peter Nelson 3 months ago committed by GitHub
parent 2dc0a33eb7
commit 4976a0140e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -438,8 +438,9 @@ struct BuildRailToolbarWindow : Window {
BuildRailToolbarWindow(WindowDesc &desc, RailType railtype) : Window(desc)
{
this->InitNested(TRANSPORT_RAIL);
this->CreateNestedTree();
this->SetupRailToolbar(railtype);
this->FinishInitNested(TRANSPORT_RAIL);
this->DisableWidget(WID_RAT_REMOVE);
this->OnInvalidateData();
this->last_user_action = INVALID_WID_RAT;

@ -349,8 +349,9 @@ struct BuildRoadToolbarWindow : Window {
BuildRoadToolbarWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc)
{
this->Initialize(_cur_roadtype);
this->InitNested(window_number);
this->CreateNestedTree();
this->SetupRoadToolbar();
this->FinishInitNested(window_number);
this->SetWidgetDisabledState(WID_ROT_REMOVE, true);
if (RoadTypeIsRoad(this->roadtype)) {

Loading…
Cancel
Save