diff src/station_gui.cpp @ 9389:b81a2f5313a9 draft

(svn r13299) -Fix (r13286): Stations sort type isn't updated correctly
author skidd13 <skidd13@openttd.org>
date Tue, 27 May 2008 20:33:44 +0000
parents 6d8ee9e0b359
children 45c874394355
line wrap: on
line diff
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -202,11 +202,7 @@
 		/* Reset name sorter sort cache */
 		this->last_station = NULL;
 
-		/* Display the current sort variant */
-		this->widget[SLW_SORTDROPBTN].data = this->sorter_names[this->stations.SortType()];
-
-		/* Set the modified widgets dirty */
-		this->InvalidateWidget(SLW_SORTDROPBTN);
+		/* Set the modified widget dirty */
 		this->InvalidateWidget(SLW_LIST);
 	}
 
@@ -274,6 +270,8 @@
 		this->stations.NeedResort();
 		this->SortStationsList();
 
+		this->widget[SLW_SORTDROPBTN].data = this->sorter_names[this->stations.SortType()];
+
 		this->FindWindowPlacementAndResize(desc);
 	}
 
@@ -501,6 +499,10 @@
 	{
 		if (this->stations.SortType() != index) {
 			this->stations.SetSortType(index);
+
+			/* Display the current sort variant */
+			this->widget[SLW_SORTDROPBTN].data = this->sorter_names[this->stations.SortType()];
+
 			this->SetDirty();
 		}
 	}