changeset 13024:aa1f3a190f19 draft

(svn r17522) -Fix: Scroll to selected content after sorting the list and after updating the scrollbar maximum.
author frosch <frosch@openttd.org>
date Sun, 13 Sep 2009 14:50:52 +0000
parents 44ceb5ee6fed
children 8acd1900fe45
files src/network/network_content_gui.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -251,8 +251,10 @@
 		this->FilterContentList();
 		this->content.Compact();
 		this->content.RebuildDone();
+		this->SortContentList();
 
 		this->vscroll.SetCount(this->content.Length()); // Update the scrollbar
+		this->ScrollToSelected();
 	}
 
 	/** Sort content by name. */
@@ -315,7 +317,6 @@
 		for (ConstContentIterator iter = this->content.Begin(); iter != this->content.End(); iter++) {
 			if (*iter == this->selected) {
 				this->list_pos = iter - this->content.Begin();
-				this->ScrollToSelected();
 				return;
 			}
 		}
@@ -376,7 +377,6 @@
 		if (this->content.NeedRebuild()) {
 			this->BuildContentList();
 		}
-		this->SortContentList();
 
 		/* To sum all the bytes we intend to download */
 		uint filesize = 0;