diff options
author | alberth <alberth@openttd.org> | 2009-12-20 20:08:39 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-12-20 20:08:39 +0000 |
commit | 5a083f183e5ece4e379a12d7f5b927e54a83d04a (patch) | |
tree | 1d1fa960c0fffff8e0462b8086f4c46434b91773 /src/vehicle_gui.cpp | |
parent | 20debea202d87ce595b2ebc353d22204e9820efc (diff) | |
download | openttd-5a083f183e5ece4e379a12d7f5b927e54a83d04a.tar.xz |
(svn r18580) -Codechange: Use widget information only for setting scrollbar capacity.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r-- | src/vehicle_gui.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 830c022b5..0e40b94e8 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -494,9 +494,8 @@ struct RefitWindow : public Window { virtual void OnResize() { - NWidgetCore *nwi = this->GetWidget<NWidgetCore>(VRW_MATRIX); - this->vscroll.SetCapacity(nwi->current_y / this->resize.step_height); - nwi->widget_data = (this->vscroll.GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START); + this->vscroll.SetCapacityFromWidget(this, VRW_MATRIX); + this->GetWidget<NWidgetCore>(VRW_MATRIX)->widget_data = (this->vscroll.GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START); } }; @@ -1243,7 +1242,7 @@ public: virtual void OnResize() { - this->vscroll.SetCapacity(this->GetWidget<NWidgetBase>(VLW_WIDGET_LIST)->current_y / this->resize.step_height); + this->vscroll.SetCapacityFromWidget(this, VLW_WIDGET_LIST); this->GetWidget<NWidgetCore>(VLW_WIDGET_LIST)->widget_data = (this->vscroll.GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START); } @@ -1683,7 +1682,7 @@ struct VehicleDetailsWindow : Window { { NWidgetCore *nwi = this->GetWidget<NWidgetCore>(VLD_WIDGET_MATRIX); if (nwi != NULL) { - this->vscroll.SetCapacity(nwi->current_y / this->resize.step_height); + this->vscroll.SetCapacityFromWidget(this, VLD_WIDGET_MATRIX); nwi->widget_data = (this->vscroll.GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START); } } |