mirror of https://github.com/OpenTTD/OpenTTD
(svn r17522) -Fix: Scroll to selected content after sorting the list and after updating the scrollbar maximum.
parent
d0836f9ec8
commit
0c8c208569
|
@ -251,8 +251,10 @@ class NetworkContentListWindow : public QueryStringBaseWindow, ContentCallback {
|
||||||
this->FilterContentList();
|
this->FilterContentList();
|
||||||
this->content.Compact();
|
this->content.Compact();
|
||||||
this->content.RebuildDone();
|
this->content.RebuildDone();
|
||||||
|
this->SortContentList();
|
||||||
|
|
||||||
this->vscroll.SetCount(this->content.Length()); // Update the scrollbar
|
this->vscroll.SetCount(this->content.Length()); // Update the scrollbar
|
||||||
|
this->ScrollToSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sort content by name. */
|
/** Sort content by name. */
|
||||||
|
@ -315,7 +317,6 @@ class NetworkContentListWindow : public QueryStringBaseWindow, ContentCallback {
|
||||||
for (ConstContentIterator iter = this->content.Begin(); iter != this->content.End(); iter++) {
|
for (ConstContentIterator iter = this->content.Begin(); iter != this->content.End(); iter++) {
|
||||||
if (*iter == this->selected) {
|
if (*iter == this->selected) {
|
||||||
this->list_pos = iter - this->content.Begin();
|
this->list_pos = iter - this->content.Begin();
|
||||||
this->ScrollToSelected();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -376,7 +377,6 @@ public:
|
||||||
if (this->content.NeedRebuild()) {
|
if (this->content.NeedRebuild()) {
|
||||||
this->BuildContentList();
|
this->BuildContentList();
|
||||||
}
|
}
|
||||||
this->SortContentList();
|
|
||||||
|
|
||||||
/* To sum all the bytes we intend to download */
|
/* To sum all the bytes we intend to download */
|
||||||
uint filesize = 0;
|
uint filesize = 0;
|
||||||
|
|
Loading…
Reference in New Issue