summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ai/ai_gui.cpp4
-rw-r--r--src/group_gui.cpp2
-rw-r--r--src/newgrf_gui.cpp2
-rw-r--r--src/news_gui.cpp2
4 files changed, 5 insertions, 5 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index ff3a8a502..0736e9ba9 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -211,7 +211,7 @@ struct AIListWindow : public Window {
virtual void OnResize()
{
NWidgetCore *nwi = this->GetWidget<NWidgetCore>(WID_AIL_LIST);
- this->vscroll->SetCapacity(nwi->current_y / this->line_height);
+ this->vscroll->SetCapacityFromWidget(this, WID_AIL_LIST);
nwi->widget_data = (this->vscroll->GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
}
@@ -562,7 +562,7 @@ struct AISettingsWindow : public Window {
virtual void OnResize()
{
NWidgetCore *nwi = this->GetWidget<NWidgetCore>(WID_AIS_BACKGROUND);
- this->vscroll->SetCapacity(nwi->current_y / this->line_height);
+ this->vscroll->SetCapacityFromWidget(this, WID_AIS_BACKGROUND);
nwi->widget_data = (this->vscroll->GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
}
diff --git a/src/group_gui.cpp b/src/group_gui.cpp
index af2941527..8c1859764 100644
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -680,7 +680,7 @@ public:
virtual void OnResize()
{
NWidgetCore *nwi = this->GetWidget<NWidgetCore>(WID_GL_LIST_GROUP);
- this->group_sb->SetCapacity(nwi->current_y / this->tiny_step_height);
+ this->group_sb->SetCapacityFromWidget(this, WID_GL_LIST_GROUP);
nwi->widget_data = (this->group_sb->GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
nwi = this->GetWidget<NWidgetCore>(WID_GL_LIST_VEHICLE);
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 37ed023b0..694510b1a 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -461,7 +461,7 @@ struct NewGRFParametersWindow : public Window {
virtual void OnResize()
{
NWidgetCore *nwi = this->GetWidget<NWidgetCore>(WID_NP_BACKGROUND);
- this->vscroll->SetCapacity(nwi->current_y / this->line_height);
+ this->vscroll->SetCapacityFromWidget(this, WID_NP_BACKGROUND);
nwi->widget_data = (this->vscroll->GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
}
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index f8e77161e..89448edea 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -1084,7 +1084,7 @@ struct MessageHistoryWindow : Window {
virtual void OnResize()
{
- this->vscroll->SetCapacity(this->GetWidget<NWidgetBase>(WID_MH_BACKGROUND)->current_y / this->line_height);
+ this->vscroll->SetCapacityFromWidget(this, WID_MH_BACKGROUND);
}
};