summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-12-20 20:08:39 +0000
committeralberth <alberth@openttd.org>2009-12-20 20:08:39 +0000
commit5a083f183e5ece4e379a12d7f5b927e54a83d04a (patch)
tree1d1fa960c0fffff8e0462b8086f4c46434b91773 /src/network
parent20debea202d87ce595b2ebc353d22204e9820efc (diff)
downloadopenttd-5a083f183e5ece4e379a12d7f5b927e54a83d04a.tar.xz
(svn r18580) -Codechange: Use widget information only for setting scrollbar capacity.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_content_gui.cpp2
-rw-r--r--src/network/network_gui.cpp10
2 files changed, 5 insertions, 7 deletions
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index b91aa02f2..7d3c223db 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -730,7 +730,7 @@ public:
virtual void OnResize()
{
- this->vscroll.SetCapacity(this->GetWidget<NWidgetBase>(NCLWW_MATRIX)->current_y / this->resize.step_height);
+ this->vscroll.SetCapacityFromWidget(this, NCLWW_MATRIX);
this->GetWidget<NWidgetCore>(NCLWW_MATRIX)->widget_data = (this->vscroll.GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
}
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 4ba226266..514f38521 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -895,9 +895,8 @@ public:
virtual void OnResize()
{
- NWidgetCore *nwi = this->GetWidget<NWidgetCore>(NGWW_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, NGWW_MATRIX);
+ this->GetWidget<NWidgetCore>(NGWW_MATRIX)->widget_data = (this->vscroll.GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
}
};
@@ -1673,9 +1672,8 @@ struct NetworkLobbyWindow : public Window {
virtual void OnResize()
{
- NWidgetCore *nwi = this->GetWidget<NWidgetCore>(NLWW_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, NLWW_MATRIX);
+ this->GetWidget<NWidgetCore>(NLWW_MATRIX)->widget_data = (this->vscroll.GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
}
};