diff options
author | alberth <alberth@openttd.org> | 2009-11-22 18:28:14 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-11-22 18:28:14 +0000 |
commit | 450e40b997ac0ac29c79abfeb1b96bb9bf2b8eed (patch) | |
tree | 92e398cb5c485eb3d525b5046c352b0beae302a3 /src | |
parent | 2b6f79251372ba2ac8fd59a4de2ee604e96c34af (diff) | |
download | openttd-450e40b997ac0ac29c79abfeb1b96bb9bf2b8eed.tar.xz |
(svn r18230) -Codechange: Allow fill stepsize to be set from Window::UpdateWidgetSize().
Diffstat (limited to 'src')
35 files changed, 82 insertions, 76 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 935873cf6..1738773bc 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -76,7 +76,7 @@ struct AIListWindow : public Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget == AIL_WIDGET_LIST) { this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM; @@ -279,7 +279,7 @@ struct AISettingsWindow : public Window { this->vscroll.SetCount((int)this->ai_config->GetConfigList()->size()); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget == AIS_WIDGET_BACKGROUND) { this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM; @@ -544,7 +544,7 @@ struct AIConfigWindow : public Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case AIC_WIDGET_LIST: @@ -698,7 +698,7 @@ struct AIDebugWindow : public Window { if (ai_debug_company != INVALID_COMPANY) this->LowerWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget == AID_WIDGET_LOG_PANEL) { resize->height = FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 2c48feade..4b11d968c 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -231,7 +231,7 @@ public: this->sel_group = id_g; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case RVW_WIDGET_LEFT_MATRIX: diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 13802ddf7..3a253a593 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -164,7 +164,7 @@ public: this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case BBSW_DROPDOWN_ORDER: { diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index f25c0a026..5d3953247 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1086,7 +1086,7 @@ struct BuildVehicleWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case BUILD_VEHICLE_WIDGET_LIST: diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp index 74bd21faf..9b92a381f 100644 --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -215,7 +215,7 @@ struct CheatWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != CW_PANEL) return; diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 44b724c0a..40ea52e8c 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -320,7 +320,7 @@ struct CompanyFinancesWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { int type = _settings_client.gui.expenses_layout; switch (widget) { @@ -596,7 +596,7 @@ public: this->LowerWidget(SCLW_WIDGET_CLASS_GENERAL); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { /* Number of liveries in each class, used to determine the height of the livery matrix widget. */ static const byte livery_height[] = { @@ -1646,7 +1646,7 @@ struct CompanyWindow : Window this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case CW_WIDGET_DESC_COMPANY_VALUE: @@ -1922,7 +1922,7 @@ struct BuyCompanyWindow : Window { this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case BCW_FACE: diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index bdaea1457..1b5e7367f 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -612,7 +612,7 @@ struct DepotWindow : Window { uint flag_width; uint flag_height; - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case DEPOT_WIDGET_SELL_CHAIN: diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 2558056ae..a165acf64 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -80,7 +80,7 @@ struct EnginePreviewWindow : Window { this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != EPW_QUESTION) return; diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index 10d1b6b35..9ef00bfbe 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -411,7 +411,7 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { const StringID *strs = NULL; switch (widget) { @@ -901,7 +901,7 @@ struct CreateScenarioWindow : public Window this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { StringID str = STR_JUST_INT; switch (widget) { @@ -1188,7 +1188,7 @@ struct GenerateProgressWindow : public Window { this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case GPWW_PROGRESS_BAR: { diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 6730dd231..db1fd1884 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -786,7 +786,7 @@ struct PaymentRatesGraphWindow : BaseGraphWindow { this->InitNested(desc, window_number); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget < CPW_CARGO_FIRST) return; @@ -1109,7 +1109,7 @@ struct PerformanceRatingDetailWindow : Window { uint score_detail_left; uint score_detail_right; - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case PRW_SCORE_FIRST: diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 8f92d5220..f1cb1dc2b 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -249,7 +249,7 @@ public: *this->sorting = this->vehicles.GetListing(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case GRP_WIDGET_LIST_GROUP: diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index f1ba1eb61..5e16dfc5e 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -207,7 +207,7 @@ public: this->InitNested(&_build_industry_desc, 0); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case DPIW_MATRIX_WIDGET: { @@ -702,7 +702,7 @@ public: if (widget== IVW_CAPTION) SetDParam(0, this->window_number); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget == IVW_INFO) size->height = this->info_height; } @@ -1077,7 +1077,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case IDW_DROPDOWN_ORDER: { diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index b92ee19ba..aac79ce04 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -84,7 +84,7 @@ struct SelectGameWindow : public Window { if (widget == SGI_DIFFICULTIES) SetDParam(0, STR_DIFFICULTY_LEVEL_EASY + _settings_newgame.difficulty.diff_level); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != SGI_DIFFICULTIES) return; diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index de3b49800..7cc932db5 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -114,7 +114,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != LIW_BACKGROUND) return; @@ -432,7 +432,7 @@ struct AboutWindow : public Window { if (widget == AW_WEBSITE) SetDParamStr(0, "Website: http://www.openttd.org"); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != AW_SCROLLING_TEXT) return; @@ -559,7 +559,7 @@ public: this->InitNested(desc); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != EMW_MESSAGE) return; @@ -823,7 +823,7 @@ struct TooltipsWindow : public Window return pt; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { /* There is only one widget. */ for (uint i = 0; i != this->paramcount; i++) SetDParam(i, this->params[i]); @@ -1339,7 +1339,7 @@ struct QueryStringWindow : public QueryStringBaseWindow this->LowerWidget(QUERY_STR_WIDGET_TEXT); } - void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget == QUERY_STR_WIDGET_DEFAULT && (this->flags & QSF_ENABLE_DEFAULT) == 0) { this->GetWidget<NWidgetCore>(widget)->SetFill(0, 1); @@ -1518,7 +1518,7 @@ struct QueryWindow : public Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != QUERY_WIDGET_TEXT) return; @@ -1865,7 +1865,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case SLWW_CONTENT_DOWNLOAD_SEL: diff --git a/src/music_gui.cpp b/src/music_gui.cpp index c08fc4dae..31b86bec1 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -250,7 +250,7 @@ struct MusicTrackSelectionWindow : public Window { this->SetDirty(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case MTSW_PLAYLIST: { @@ -462,7 +462,7 @@ struct MusicWindow : public Window { this->SetWidgetLoweredState(MW_SHUFFLE, msf.shuffle); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { /* Make sure that MW_SHUFFLE and MW_PROGRAMME have the same size. diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index 731375b4d..0368a94d2 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -455,7 +455,7 @@ struct NetworkChatWindow : public QueryStringBaseWindow { return pt; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != NWCW_DESTINATION) return; diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index bdaf270e4..ddcd19ebc 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -376,7 +376,7 @@ public: _network_content_client.RemoveCallback(this); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case NCLWW_FILTER_CAPT: diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index b9376eedc..77dc0a6e7 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -481,7 +481,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case NGWW_CONN_BTN: @@ -1108,7 +1108,7 @@ struct NetworkStartServerWindow : public QueryStringBaseWindow { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case NSSW_CONNTYPE_BTN: @@ -1486,7 +1486,7 @@ struct NetworkLobbyWindow : public Window { return COMPANY_FIRST; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case NLWW_HEADER: @@ -1904,7 +1904,7 @@ struct NetworkClientListPopupWindow : Window { return this->desired_location; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { Dimension d = *size; for (const ClientListAction *action = this->actions.Begin(); action != this->actions.End(); action++) { @@ -2037,7 +2037,7 @@ struct NetworkClientListWindow : Window { return true; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != CLW_PANEL) return; diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 98f91a83c..2263fd058 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -264,7 +264,7 @@ public: this->SetWidgetDisabledState(ANGRFW_ADD, this->sel == NULL || this->sel->IsOpenTTDBaseGRF()); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case ANGRFW_GRF_LIST: @@ -580,7 +580,7 @@ struct NewGRFWindow : public Window { _grf_preset_list.Clear(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case SNGRFS_FILE_LIST: diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 81bb04b9e..9f5708626 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -344,7 +344,7 @@ struct NewsWindow : Window { this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { StringID str = STR_NULL; switch (widget) { @@ -927,7 +927,7 @@ struct MessageHistoryWindow : Window { this->OnInvalidateData(0); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget == MHW_BACKGROUND) { this->line_height = FONT_HEIGHT_NORMAL + 2; @@ -1114,7 +1114,7 @@ struct MessageOptionsWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget >= WIDGET_NEWSOPT_START_OPTION && widget < WIDGET_NEWSOPT_END_OPTION) { /* Height is the biggest widget height in a row. */ diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 89430bee3..e1068f8bf 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -690,7 +690,7 @@ public: this->OnInvalidateData(-2); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case ORDER_WIDGET_TIMETABLE_VIEW: diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index f7a4f24b1..c2e697dfc 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -1085,7 +1085,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case BRSW_NEWST_DROPDOWN: { diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 05494240c..f359b8f6c 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -229,7 +229,7 @@ struct GameOptionsWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case GOW_BASE_GRF_DESCRIPTION: @@ -569,7 +569,7 @@ public: SetDParam(0, sd->desc.str + value); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { /* Only for the 'descriptions' */ int index = widget - GDW_OPTIONS_START; @@ -1477,7 +1477,7 @@ struct GameSettingsWindow : Window { this->vscroll.SetCount(_settings_main_page.Length()); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != SETTINGSEL_OPTIONSPANEL) return; @@ -1760,7 +1760,7 @@ struct CustomCurrencyWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { /* Set the appropriate width for the edit 'buttons' */ diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 432a6cdbc..03391a9ec 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -164,7 +164,7 @@ struct SignListWindow : Window, SignList { this->vscroll.SetCapacity((this->GetWidget<NWidgetBase>(SLW_LIST)->current_y - WD_FRAMERECT_TOP - WD_FRAMERECT_BOTTOM) / this->resize.step_height); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case SLW_LIST: { diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index e31b9429c..813e82dd7 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -856,7 +856,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != SM_WIDGET_LEGEND) return; diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 77c26546d..dd4dd2a8a 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -291,7 +291,7 @@ public: this->last_sorting = this->stations.GetListing(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case SLW_SORTDROPBTN: { @@ -808,7 +808,7 @@ struct StationViewWindow : public Window { DeleteWindowById(WC_AIRCRAFT_LIST, wno | (VEH_AIRCRAFT << 11), false); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case SVW_WAITING: @@ -1293,7 +1293,7 @@ struct SelectStationWindow : Window { this->OnInvalidateData(0); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != JSW_PANEL) return; diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp index 524f00417..7daf4313d 100644 --- a/src/statusbar_gui.cpp +++ b/src/statusbar_gui.cpp @@ -109,7 +109,7 @@ struct StatusBarWindow : Window { this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { size->height = FONT_HEIGHT_NORMAL + padding.height; } diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp index 9a5007fab..4d6e17530 100644 --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -141,7 +141,7 @@ struct SubsidyListWindow : Window { return 3 + num_awarded + num_not_awarded; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != SLW_PANEL) return; Dimension d = maxdim(GetStringBoundingBox(STR_SUBSIDIES_OFFERED_TITLE), GetStringBoundingBox(STR_SUBSIDIES_SUBSIDISED_TITLE)); diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 348bd0f0d..dfb722d76 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -68,7 +68,7 @@ struct TimetableWindow : Window { this->sel_index = -1; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case TTV_TIMETABLE_PANEL: diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index f94a89969..8872b2bec 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -1437,7 +1437,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case TBSE_SPACERPANEL: diff --git a/src/town_gui.cpp b/src/town_gui.cpp index e64284a31..aaa52a8de 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -211,7 +211,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case TWA_ACTION_INFO: { @@ -717,7 +717,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case TDW_SORTNAME: diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp index 3cb2fbda6..04a07566d 100644 --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -62,7 +62,7 @@ public: ResetObjectToPlace(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != BTW_MANY_RANDOM) return; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 3ddee50e4..1c3e2ebed 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -351,7 +351,7 @@ struct RefitWindow : public Window { this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case VRW_MATRIX: @@ -956,7 +956,7 @@ public: *this->sorting = this->vehicles.GetListing(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != VLW_WIDGET_LIST) return; @@ -1361,7 +1361,7 @@ struct VehicleDetailsWindow : Window { this->tab = TDW_TAB_CARGO; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case VLD_WIDGET_TOP_DETAILS: @@ -1849,7 +1849,7 @@ public: DeleteWindowById(WC_VEHICLE_TIMETABLE, this->window_number, false); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { const Vehicle *v = Vehicle::Get(this->window_number); switch (widget) { diff --git a/src/widget.cpp b/src/widget.cpp index 386e2cf22..9f1dce98e 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -955,17 +955,17 @@ void NWidgetStacked::SetupSmallestSize(Window *w, bool init_array) /* Zero size plane selected */ if (this->shown_plane == STACKED_SELECTION_ZERO_SIZE) { - this->fill_x = 0; - this->fill_y = 0; - Dimension size = {0, 0}; - Dimension resize = {0, 0}; Dimension padding = {0, 0}; + Dimension fill = {0, 0}; + Dimension resize = {0, 0}; /* Here we're primarily interested in the value of resize */ - w->UpdateWidgetSize(this->index, &size, padding, &resize); + w->UpdateWidgetSize(this->index, &size, padding, &fill, &resize); this->smallest_x = size.width; this->smallest_y = size.height; + this->fill_x = fill.width; + this->fill_y = fill.height; this->resize_x = resize.width; this->resize_y = resize.height; return; @@ -1453,6 +1453,7 @@ void NWidgetBackground::SetupSmallestSize(Window *w, bool init_array) } } else { Dimension d = {this->min_x, this->min_y}; + Dimension fill = {this->fill_x, this->fill_y}; Dimension resize = {this->resize_x, this->resize_y}; if (w != NULL) { // A non-NULL window pointer acts as switch to turn dynamic widget size on. if (this->type == WWT_FRAME || this->type == WWT_INSET) { @@ -1463,11 +1464,13 @@ void NWidgetBackground::SetupSmallestSize(Window *w, bool init_array) } if (this->index >= 0) { static const Dimension padding = {0, 0}; - w->UpdateWidgetSize(this->index, &d, padding, &resize); + w->UpdateWidgetSize(this->index, &d, padding, &fill, &resize); } } this->smallest_x = d.width; this->smallest_y = d.height; + this->fill_x = fill.width; + this->fill_y = fill.height; this->resize_x = resize.width; this->resize_y = resize.height; } @@ -1744,6 +1747,7 @@ void NWidgetLeaf::SetupSmallestSize(Window *w, bool init_array) /* A non-NULL window pointer acts as switch to turn dynamic widget sizing on. */ Dimension size = {this->min_x, this->min_y}; + Dimension fill = {this->fill_x, this->fill_y}; Dimension resize = {this->resize_x, this->resize_y}; /* Get padding, and update size with the real content size if appropriate. */ const Dimension *padding = NULL; @@ -1869,13 +1873,14 @@ void NWidgetLeaf::SetupSmallestSize(Window *w, bool init_array) NOT_REACHED(); } - if (this->index >= 0) w->UpdateWidgetSize(this->index, &size, *padding, &resize); + if (this->index >= 0) w->UpdateWidgetSize(this->index, &size, *padding, &fill, &resize); this->smallest_x = size.width; this->smallest_y = size.height; + this->fill_x = fill.width; + this->fill_y = fill.height; this->resize_x = resize.width; this->resize_y = resize.height; - /* this->fill_x and this->fill_y are already correct. */ } void NWidgetLeaf::Draw(const Window *w) diff --git a/src/window_gui.h b/src/window_gui.h index d0e0f48a2..a920ac648 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -577,9 +577,10 @@ public: * @param widget Widget number. * @param size Size of the widget. * @param padding Recommended amount of space between the widget content and the widget edge. + * @param fill Fill step of the widget. * @param resize Resize step of the widget. */ - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) {} + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) {} /** * Initialize string parameters for a widget. |