From b2946819e470a79bac3d3cc2ccdc5b5771d7954c Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 4 Nov 2009 15:50:14 +0000 Subject: (svn r17970) -Codechange: some coding style / improvement of constant usage --- src/toolbar_gui.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index 6c09c3a71..c5d415be0 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -1045,7 +1045,7 @@ struct MainToolbarWindow : Window { * Since enabled state is the default, just disable when needed */ this->SetWidgetsDisabledState(_local_company == COMPANY_SPECTATOR, TBN_RAILS, TBN_ROADS, TBN_WATER, TBN_AIR, TBN_LANDSCAPE, WIDGET_LIST_END); /* disable company list drop downs, if there are no companies */ - this->SetWidgetsDisabledState(Company::GetNumItems() == TBN_PAUSE, TBN_STATIONS, TBN_FINANCES, TBN_TRAINS, TBN_ROADVEHS, TBN_SHIPS, TBN_AIRCRAFTS, WIDGET_LIST_END); + this->SetWidgetsDisabledState(Company::GetNumItems() == 0, TBN_STATIONS, TBN_FINANCES, TBN_TRAINS, TBN_ROADVEHS, TBN_SHIPS, TBN_AIRCRAFTS, WIDGET_LIST_END); this->SetWidgetDisabledState(TBN_RAILS, !CanBuildVehicleInfrastructure(VEH_TRAIN)); this->SetWidgetDisabledState(TBN_AIR, !CanBuildVehicleInfrastructure(VEH_AIRCRAFT)); @@ -1138,7 +1138,9 @@ struct MainToolbarWindow : Window { virtual void OnTimeout() { - for (uint i = TBN_SETTINGS; i < this->widget_count - 1; i++) { + /* We do not want to automatically raise the pause, fast forward and + * switchbar buttons; they have to stay down when pressed etc. */ + for (uint i = TBN_SETTINGS; i < TBN_SWITCHBAR; i++) { if (this->IsWidgetLowered(i)) { this->RaiseWidget(i); this->SetWidgetDirty(i); -- cgit v1.2.3-54-g00ecf