Mercurial > hg > openttd
changeset 20589:32521c1e0f03 draft
(svn r25533) -Codechange: Use SetCapacityFromWidget more often.
author | frosch <frosch@openttd.org> |
---|---|
date | Sun, 30 Jun 2013 14:33:32 +0000 |
parents | f97d0e2b7784 |
children | 48473b271f8a |
files | src/ai/ai_gui.cpp src/group_gui.cpp src/newgrf_gui.cpp src/news_gui.cpp |
diffstat | 4 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -211,7 +211,7 @@ 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 @@ 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); }
--- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -680,7 +680,7 @@ 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);
--- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -461,7 +461,7 @@ 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); }