(svn r25537) -Codechange: Optionally make WWT_MATRIX compute the number of rows and columns from the resize step size.

This commit is contained in:
frosch
2013-06-30 14:36:31 +00:00
parent 8116aeff21
commit 43ec0bf0c1
16 changed files with 42 additions and 59 deletions

View File

@@ -890,7 +890,6 @@ public:
virtual void OnResize()
{
this->vscroll->SetCapacityFromWidget(this, WID_NG_MATRIX);
this->GetWidget<NWidgetCore>(WID_NG_MATRIX)->widget_data = (this->vscroll->GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
}
virtual void OnTick()
@@ -946,7 +945,7 @@ static const NWidgetPart _nested_network_game_widgets[] = {
NWidget(NWID_VERTICAL),
NWidgetFunction(MakeResizableHeader),
NWidget(WWT_MATRIX, COLOUR_LIGHT_BLUE, WID_NG_MATRIX), SetResize(1, 1), SetFill(1, 0),
SetMatrixDataTip(0, 0, STR_NETWORK_SERVER_LIST_CLICK_GAME_TO_SELECT), SetScrollbar(WID_NG_SCROLLBAR),
SetMatrixDataTip(1, 0, STR_NETWORK_SERVER_LIST_CLICK_GAME_TO_SELECT), SetScrollbar(WID_NG_SCROLLBAR),
EndContainer(),
NWidget(NWID_VSCROLLBAR, COLOUR_LIGHT_BLUE, WID_NG_SCROLLBAR),
EndContainer(),
@@ -1572,7 +1571,6 @@ struct NetworkLobbyWindow : public Window {
virtual void OnResize()
{
this->vscroll->SetCapacityFromWidget(this, WID_NL_MATRIX);
this->GetWidget<NWidgetCore>(WID_NL_MATRIX)->widget_data = (this->vscroll->GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
}
};
@@ -1588,7 +1586,7 @@ static const NWidgetPart _nested_network_lobby_window_widgets[] = {
/* Company list. */
NWidget(NWID_VERTICAL),
NWidget(WWT_PANEL, COLOUR_WHITE, WID_NL_HEADER), SetMinimalSize(146, 0), SetResize(1, 0), SetFill(1, 0), EndContainer(),
NWidget(WWT_MATRIX, COLOUR_LIGHT_BLUE, WID_NL_MATRIX), SetMinimalSize(146, 0), SetResize(1, 1), SetFill(1, 1), SetMatrixDataTip(0, 0, STR_NETWORK_GAME_LOBBY_COMPANY_LIST_TOOLTIP), SetScrollbar(WID_NL_SCROLLBAR),
NWidget(WWT_MATRIX, COLOUR_LIGHT_BLUE, WID_NL_MATRIX), SetMinimalSize(146, 0), SetResize(1, 1), SetFill(1, 1), SetMatrixDataTip(1, 0, STR_NETWORK_GAME_LOBBY_COMPANY_LIST_TOOLTIP), SetScrollbar(WID_NL_SCROLLBAR),
EndContainer(),
NWidget(NWID_VSCROLLBAR, COLOUR_LIGHT_BLUE, WID_NL_SCROLLBAR),
NWidget(NWID_SPACER), SetMinimalSize(5, 0), SetResize(0, 1),