summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/station_gui.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/station_gui.cpp b/src/station_gui.cpp
index 01bff3a6c..aade14c44 100644
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -1226,7 +1226,7 @@ struct SelectStationWindow : Window {
this->vscroll.SetCapacity(6);
this->resize.step_height = 10;
- FindStationsNearby<T>(this->area, true);
+ this->OnInvalidateData(0);
this->widget[JSW_WIDGET_CAPTION].data = T::EXPECTED_FACIL == FACIL_WAYPOINT ? STR_JOIN_WAYPOINT_CAPTION : STR_JOIN_STATION_CAPTION;
this->FindWindowPlacementAndResize(desc);
@@ -1234,8 +1234,6 @@ struct SelectStationWindow : Window {
virtual void OnPaint()
{
- this->vscroll.SetCount(_stations_nearby_list.Length() + 1);
-
this->DrawWidgets();
uint y = 17;
@@ -1286,12 +1284,13 @@ struct SelectStationWindow : Window {
virtual void OnResize(Point delta)
{
- this->vscroll.UpdateCapacity((this->widget[JSW_PANEL].bottom - this->widget[JSW_PANEL].top) / 10);
+ this->vscroll.UpdateCapacity(delta.y / 10);
}
virtual void OnInvalidateData(int data)
{
FindStationsNearby<T>(this->area, true);
+ this->vscroll.SetCount(_stations_nearby_list.Length() + 1);
this->SetDirty();
}
};