1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-28 17:09:10 +00:00

(svn r18580) -Codechange: Use widget information only for setting scrollbar capacity.

This commit is contained in:
alberth
2009-12-20 20:08:39 +00:00
parent 20debea202
commit 5a083f183e
21 changed files with 53 additions and 39 deletions

View File

@@ -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);
}

View File

@@ -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);
}
};