summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-05-26 19:30:07 +0000
committerfrosch <frosch@openttd.org>2013-05-26 19:30:07 +0000
commit4e4e635916d7852c0da9a53edd2d510080922ed5 (patch)
tree3131851c69f879767d377c68d8e7c8a3f9910a9a
parent559b7ef35eb4896e4f2e35d2dc8afb3d86519c3e (diff)
downloadopenttd-4e4e635916d7852c0da9a53edd2d510080922ed5.tar.xz
(svn r25294) -Feature: Add another button to window title bars to resize the window to its default size.
-rw-r--r--src/ai/ai_gui.cpp3
-rw-r--r--src/autoreplace_gui.cpp2
-rw-r--r--src/bridge_gui.cpp1
-rw-r--r--src/build_vehicle_gui.cpp1
-rw-r--r--src/depot_gui.cpp1
-rw-r--r--src/fios_gui.cpp3
-rw-r--r--src/goal_gui.cpp1
-rw-r--r--src/graph_gui.cpp6
-rw-r--r--src/group_gui.cpp1
-rw-r--r--src/industry_gui.cpp4
-rw-r--r--src/lang/english.txt3
-rw-r--r--src/network/network_content_gui.cpp1
-rw-r--r--src/network/network_gui.cpp1
-rw-r--r--src/newgrf_debug_gui.cpp1
-rw-r--r--src/newgrf_gui.cpp2
-rw-r--r--src/news_gui.cpp1
-rw-r--r--src/object_gui.cpp1
-rw-r--r--src/order_gui.cpp3
-rw-r--r--src/rail_gui.cpp2
-rw-r--r--src/settings_gui.cpp1
-rw-r--r--src/signs_gui.cpp1
-rw-r--r--src/smallmap_gui.cpp1
-rw-r--r--src/station_gui.cpp3
-rw-r--r--src/subsidy_gui.cpp1
-rw-r--r--src/textfile_gui.cpp1
-rw-r--r--src/timetable_gui.cpp1
-rw-r--r--src/town_gui.cpp4
-rw-r--r--src/vehicle_gui.cpp5
-rw-r--r--src/viewport_gui.cpp1
-rw-r--r--src/waypoint_gui.cpp1
-rw-r--r--src/widget.cpp39
-rw-r--r--src/widget_type.h9
-rw-r--r--src/window.cpp25
-rw-r--r--src/window_gui.h7
34 files changed, 133 insertions, 5 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index 977a4e141..3e54cd2b3 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -240,6 +240,7 @@ static const NWidgetPart _nested_ai_list_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
NWidget(WWT_CAPTION, COLOUR_MAUVE, WID_AIL_CAPTION), SetDataTip(STR_AI_LIST_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_MAUVE),
EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_MATRIX, COLOUR_MAUVE, WID_AIL_LIST), SetMinimalSize(188, 112), SetFill(1, 1), SetResize(1, 1), SetDataTip(0x501, STR_AI_LIST_TOOLTIP), SetScrollbar(WID_AIL_SCROLLBAR),
@@ -588,6 +589,7 @@ static const NWidgetPart _nested_ai_settings_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
NWidget(WWT_CAPTION, COLOUR_MAUVE, WID_AIS_CAPTION), SetDataTip(STR_AI_SETTINGS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_MAUVE),
EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_MATRIX, COLOUR_MAUVE, WID_AIS_BACKGROUND), SetMinimalSize(188, 182), SetResize(1, 1), SetFill(1, 0), SetDataTip(0x501, STR_NULL), SetScrollbar(WID_AIS_SCROLLBAR),
@@ -1447,6 +1449,7 @@ static const NWidgetPart _nested_ai_debug_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_AI_DEBUG, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY, WID_AID_VIEW),
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp
index 547b2b0e8..2ef18d121 100644
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -535,6 +535,7 @@ static const NWidgetPart _nested_replace_rail_vehicle_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_RV_CAPTION), SetDataTip(STR_REPLACE_VEHICLES_WHITE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
@@ -575,6 +576,7 @@ static const NWidgetPart _nested_replace_vehicle_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_RV_CAPTION), SetMinimalSize(433, 14), SetDataTip(STR_REPLACE_VEHICLES_WHITE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp
index 79d4e068c..6aedb78c8 100644
--- a/src/bridge_gui.cpp
+++ b/src/bridge_gui.cpp
@@ -329,6 +329,7 @@ static const NWidgetPart _nested_build_bridge_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN, WID_BBS_CAPTION), SetDataTip(STR_SELECT_RAIL_BRIDGE_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_DARK_GREEN),
EndContainer(),
NWidget(NWID_HORIZONTAL),
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index e9fdb9a36..461a3e691 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -51,6 +51,7 @@ static const NWidgetPart _nested_build_vehicle_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_BV_CAPTION), SetDataTip(STR_WHITE_STRING, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY),
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp
index e897fec21..d269bfb38 100644
--- a/src/depot_gui.cpp
+++ b/src/depot_gui.cpp
@@ -45,6 +45,7 @@ static const NWidgetPart _nested_train_depot_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_D_CAPTION), SetDataTip(STR_DEPOT_CAPTION, STR_NULL),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(NWID_HORIZONTAL),
diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp
index 75a9dd2fb..c3ef3b717 100644
--- a/src/fios_gui.cpp
+++ b/src/fios_gui.cpp
@@ -73,6 +73,7 @@ static const NWidgetPart _nested_load_dialog_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_SL_CAPTION),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY, WID_SL_BACKGROUND), SetFill(1, 0), SetResize(1, 0), EndContainer(),
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
@@ -115,6 +116,7 @@ static const NWidgetPart _nested_load_heightmap_dialog_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_SL_CAPTION),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY, WID_SL_BACKGROUND), SetFill(1, 0), SetResize(1, 0), EndContainer(),
NWidget(NWID_VERTICAL),
@@ -145,6 +147,7 @@ static const NWidgetPart _nested_save_dialog_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_SL_CAPTION),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY, WID_SL_BACKGROUND), SetFill(1, 0), SetResize(1, 0), EndContainer(),
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
diff --git a/src/goal_gui.cpp b/src/goal_gui.cpp
index 32c7b78ec..2c82ff0c2 100644
--- a/src/goal_gui.cpp
+++ b/src/goal_gui.cpp
@@ -219,6 +219,7 @@ static const NWidgetPart _nested_goals_list_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_GOALS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
EndContainer(),
NWidget(NWID_HORIZONTAL),
diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp
index 3cb5adfda..8d74ded1f 100644
--- a/src/graph_gui.cpp
+++ b/src/graph_gui.cpp
@@ -629,6 +629,7 @@ static const NWidgetPart _nested_operating_profit_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_GRAPH_OPERATING_PROFIT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_CV_KEY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY, WID_CV_BACKGROUND),
@@ -679,6 +680,7 @@ static const NWidgetPart _nested_income_graph_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_GRAPH_INCOME_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_CV_KEY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY, WID_CV_BACKGROUND),
@@ -727,6 +729,7 @@ static const NWidgetPart _nested_delivered_cargo_graph_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_GRAPH_CARGO_DELIVERED_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_CV_KEY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY, WID_CV_BACKGROUND),
@@ -782,6 +785,7 @@ static const NWidgetPart _nested_performance_history_widgets[] = {
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_PHG_DETAILED_PERFORMANCE), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_PERFORMANCE_DETAIL_KEY, STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_PHG_KEY), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY, WID_PHG_BACKGROUND),
@@ -830,6 +834,7 @@ static const NWidgetPart _nested_company_value_graph_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_GRAPH_COMPANY_VALUES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_CV_KEY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY, WID_CV_BACKGROUND),
@@ -1044,6 +1049,7 @@ static const NWidgetPart _nested_cargo_payment_rates_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_GRAPH_CARGO_PAYMENT_RATES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY, WID_CPR_BACKGROUND), SetMinimalSize(568, 128),
diff --git a/src/group_gui.cpp b/src/group_gui.cpp
index 91fd9046c..c2ac1ce82 100644
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -37,6 +37,7 @@ static const NWidgetPart _nested_group_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_GL_CAPTION),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(NWID_HORIZONTAL),
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index b7f50f248..eb1a1a9b1 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -170,6 +170,7 @@ static const NWidgetPart _nested_build_industry_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_FUND_INDUSTRY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_DARK_GREEN),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_STICKYBOX, COLOUR_DARK_GREEN),
EndContainer(),
NWidget(NWID_HORIZONTAL),
@@ -1000,6 +1001,7 @@ static const NWidgetPart _nested_industry_view_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_CREAM, WID_IV_CAPTION), SetDataTip(STR_INDUSTRY_VIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_DEBUGBOX, COLOUR_CREAM),
NWidget(WWT_SHADEBOX, COLOUR_CREAM),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_CREAM),
NWidget(WWT_STICKYBOX, COLOUR_CREAM),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_CREAM),
@@ -1035,6 +1037,7 @@ static const NWidgetPart _nested_industry_directory_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_INDUSTRY_DIRECTORY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
EndContainer(),
NWidget(NWID_HORIZONTAL),
@@ -1406,6 +1409,7 @@ static const NWidgetPart _nested_industry_cargoes_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_IC_CAPTION), SetDataTip(STR_INDUSTRY_CARGOES_INDUSTRY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
EndContainer(),
NWidget(NWID_HORIZONTAL),
diff --git a/src/lang/english.txt b/src/lang/english.txt
index 655af91e0..53c89c58d 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -232,7 +232,8 @@ STR_TOOLTIP_CLOSE_WINDOW :{BLACK}Close wi
STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS :{BLACK}Window title - drag this to move window
STR_TOOLTIP_SHADE :{BLACK}Shade window - only show the title bar
STR_TOOLTIP_DEBUG :{BLACK}Show NewGRF debug information
-STR_TOOLTIP_STICKY :{BLACK}Mark this window as uncloseable by the 'Close All Windows' key
+STR_TOOLTIP_DEFSIZE :{BLACK}Resize window to default size. Ctrl+Click to store current size as default
+STR_TOOLTIP_STICKY :{BLACK}Mark this window as uncloseable by the 'Close All Windows' key. Ctrl+Click to also save state as default
STR_TOOLTIP_RESIZE :{BLACK}Click and drag to resize this window
STR_TOOLTIP_TOGGLE_LARGE_SMALL_WINDOW :{BLACK}Toggle large/small window size
STR_TOOLTIP_VSCROLL_BAR_SCROLLS_LIST :{BLACK}Scroll bar - scrolls list up/down
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index 619526c17..4a23f95d5 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -960,6 +960,7 @@ static const NWidgetPart _nested_network_content_list_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE), SetDataTip(STR_CONTENT_TITLE, STR_NULL),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_LIGHT_BLUE),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, WID_NCL_BACKGROUND),
NWidget(NWID_SPACER), SetMinimalSize(0, 7), SetResize(1, 0),
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 56cc35e4e..ca66a9bb3 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -924,6 +924,7 @@ static const NWidgetPart _nested_network_game_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE), SetDataTip(STR_NETWORK_SERVER_LIST_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_LIGHT_BLUE),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, WID_NG_MAIN),
NWidget(NWID_VERTICAL), SetPIP(10, 7, 0),
diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp
index def656475..7a4ee06d3 100644
--- a/src/newgrf_debug_gui.cpp
+++ b/src/newgrf_debug_gui.cpp
@@ -507,6 +507,7 @@ static const NWidgetPart _nested_newgrf_inspect_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY, WID_NGRFI_CAPTION), SetDataTip(STR_NEWGRF_INSPECT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_NGRFI_PARENT), SetDataTip(STR_NEWGRF_INSPECT_PARENT_BUTTON, STR_NEWGRF_INSPECT_PARENT_TOOLTIP),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(NWID_HORIZONTAL),
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 59e39535b..eca23a18c 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -500,6 +500,7 @@ static const NWidgetPart _nested_newgrf_parameter_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
NWidget(WWT_CAPTION, COLOUR_MAUVE), SetDataTip(STR_NEWGRF_PARAMETERS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_MAUVE),
EndContainer(),
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_NP_SHOW_NUMPAR),
NWidget(WWT_PANEL, COLOUR_MAUVE), SetResize(1, 0), SetFill(1, 0), SetPIP(4, 0, 4),
@@ -1865,6 +1866,7 @@ static const NWidgetPart _nested_newgrf_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
NWidget(WWT_CAPTION, COLOUR_MAUVE), SetDataTip(STR_NEWGRF_SETTINGS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_MAUVE),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_MAUVE),
NWidgetFunction(NewGRFDisplay), SetPadding(WD_RESIZEBOX_WIDTH, WD_RESIZEBOX_WIDTH, 2, WD_RESIZEBOX_WIDTH),
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index 97c31b0d1..f8e77161e 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -1096,6 +1096,7 @@ static const NWidgetPart _nested_message_history[] = {
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_MESSAGE_HISTORY, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
EndContainer(),
diff --git a/src/object_gui.cpp b/src/object_gui.cpp
index 8af93120e..272c42cc5 100644
--- a/src/object_gui.cpp
+++ b/src/object_gui.cpp
@@ -451,6 +451,7 @@ static const NWidgetPart _nested_build_object_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_OBJECT_BUILD_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_DARK_GREEN),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN),
NWidget(NWID_HORIZONTAL), SetPadding(2, 0, 0, 0),
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 3061b4163..9f811cb10 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -1531,6 +1531,7 @@ static const NWidgetPart _nested_orders_train_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY, WID_O_CAPTION), SetDataTip(STR_ORDERS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_O_TIMETABLE_VIEW), SetMinimalSize(61, 14), SetDataTip(STR_ORDERS_TIMETABLE_VIEW, STR_ORDERS_TIMETABLE_VIEW_TOOLTIP),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(NWID_HORIZONTAL),
@@ -1607,6 +1608,7 @@ static const NWidgetPart _nested_orders_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY, WID_O_CAPTION), SetDataTip(STR_ORDERS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_O_TIMETABLE_VIEW), SetMinimalSize(61, 14), SetDataTip(STR_ORDERS_TIMETABLE_VIEW, STR_ORDERS_TIMETABLE_VIEW_TOOLTIP),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(NWID_HORIZONTAL),
@@ -1678,6 +1680,7 @@ static const NWidgetPart _nested_other_orders_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY, WID_O_CAPTION), SetDataTip(STR_ORDERS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_O_TIMETABLE_VIEW), SetMinimalSize(61, 14), SetDataTip(STR_ORDERS_TIMETABLE_VIEW, STR_ORDERS_TIMETABLE_VIEW_TOOLTIP),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(NWID_HORIZONTAL),
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index b18a219f9..d59f5f80d 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -1340,6 +1340,7 @@ static const NWidgetPart _nested_station_builder_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_STATION_BUILD_RAIL_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_DARK_GREEN),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN),
NWidget(NWID_HORIZONTAL),
@@ -1772,6 +1773,7 @@ static const NWidgetPart _nested_build_waypoint_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_WAYPOINT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_DARK_GREEN),
EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(NWID_MATRIX, COLOUR_DARK_GREEN, WID_BRW_WAYPOINT_MATRIX), SetPIP(3, 2, 3), SetScrollbar(WID_BRW_SCROLL),
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 1ec7b844e..182c2f805 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -2222,6 +2222,7 @@ static const NWidgetPart _nested_settings_selection_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
NWidget(WWT_CAPTION, COLOUR_MAUVE), SetDataTip(STR_CONFIG_SETTING_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_MAUVE),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_MAUVE),
NWidget(NWID_HORIZONTAL), SetPadding(WD_TEXTPANEL_TOP, 0, WD_TEXTPANEL_BOTTOM, 0),
diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp
index 1ff2a7524..4975bc4aa 100644
--- a/src/signs_gui.cpp
+++ b/src/signs_gui.cpp
@@ -346,6 +346,7 @@ static const NWidgetPart _nested_sign_list_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_SIL_CAPTION), SetDataTip(STR_SIGN_LIST_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(NWID_HORIZONTAL),
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index f79b0cec6..b0dae065f 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -1754,6 +1754,7 @@ static const NWidgetPart _nested_smallmap_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_SM_CAPTION), SetDataTip(STR_SMALLMAP_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
EndContainer(),
NWidgetFunction(SmallMapDisplay), // Smallmap display and legend bar + image buttons.
diff --git a/src/station_gui.cpp b/src/station_gui.cpp
index f6519fc4b..1afabe0a2 100644
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -682,6 +682,7 @@ static const NWidgetPart _nested_company_stations_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_STL_CAPTION), SetDataTip(STR_STATION_LIST_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(NWID_HORIZONTAL),
@@ -735,6 +736,7 @@ static const NWidgetPart _nested_station_view_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_SV_CAPTION), SetDataTip(STR_STATION_VIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(NWID_HORIZONTAL),
@@ -1306,6 +1308,7 @@ static const NWidgetPart _nested_select_station_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN, WID_JS_CAPTION), SetDataTip(STR_JOIN_STATION_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_DARK_GREEN),
EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_JS_PANEL), SetResize(1, 0), SetScrollbar(WID_JS_SCROLLBAR), EndContainer(),
diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp
index 8506498b6..298a8bb57 100644
--- a/src/subsidy_gui.cpp
+++ b/src/subsidy_gui.cpp
@@ -227,6 +227,7 @@ static const NWidgetPart _nested_subsidies_list_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_SUBSIDIES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
EndContainer(),
NWidget(NWID_HORIZONTAL),
diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp
index 40fa471b2..0613df336 100644
--- a/src/textfile_gui.cpp
+++ b/src/textfile_gui.cpp
@@ -27,6 +27,7 @@ static const NWidgetPart _nested_textfile_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
NWidget(WWT_CAPTION, COLOUR_MAUVE, WID_TF_CAPTION), SetDataTip(STR_NULL, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_MAUVE),
EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_PANEL, COLOUR_MAUVE, WID_TF_BACKGROUND), SetMinimalSize(200, 125), SetResize(1, 12), SetScrollbar(WID_TF_VSCROLLBAR),
diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp
index 1be6a89f0..723887945 100644
--- a/src/timetable_gui.cpp
+++ b/src/timetable_gui.cpp
@@ -650,6 +650,7 @@ static const NWidgetPart _nested_timetable_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY, WID_VT_CAPTION), SetDataTip(STR_TIMETABLE_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_VT_ORDER_VIEW), SetMinimalSize(61, 14), SetDataTip( STR_TIMETABLE_ORDER_VIEW, STR_TIMETABLE_ORDER_VIEW_TOOLTIP),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(NWID_HORIZONTAL),
diff --git a/src/town_gui.cpp b/src/town_gui.cpp
index 63f7be2b6..d0a82d0d1 100644
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -44,6 +44,7 @@ static const NWidgetPart _nested_town_authority_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_TA_CAPTION), SetDataTip(STR_LOCAL_AUTHORITY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN, WID_TA_RATING_INFO), SetMinimalSize(317, 92), SetResize(1, 1), EndContainer(),
@@ -532,6 +533,7 @@ static const NWidgetPart _nested_town_game_view_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_TV_CAPTION), SetDataTip(STR_TOWN_VIEW_TOWN_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN),
@@ -563,6 +565,7 @@ static const NWidgetPart _nested_town_editor_view_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_TV_CAPTION), SetDataTip(STR_TOWN_VIEW_TOWN_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, WID_TV_CHANGE_NAME), SetMinimalSize(76, 14), SetDataTip(STR_BUTTON_RENAME, STR_TOWN_VIEW_RENAME_TOOLTIP),
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN),
@@ -602,6 +605,7 @@ static const NWidgetPart _nested_town_directory_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_TOWN_DIRECTORY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
EndContainer(),
NWidget(NWID_HORIZONTAL),
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 248ccbaa0..a38b070df 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -978,6 +978,7 @@ static const NWidgetPart _nested_vehicle_refit_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_VR_CAPTION), SetDataTip(STR_REFIT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
EndContainer(),
/* Vehicle display + scrollbar. */
NWidget(NWID_VERTICAL),
@@ -1235,6 +1236,7 @@ static const NWidgetPart _nested_vehicle_list[] = {
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_VL_CAPTION),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
@@ -1763,6 +1765,7 @@ static const NWidgetPart _nested_nontrain_vehicle_details_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY, WID_VD_CAPTION), SetDataTip(STR_VEHICLE_DETAILS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_VD_RENAME_VEHICLE), SetMinimalSize(40, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_VEHICLE_NAME_BUTTON, STR_NULL /* filled in later */),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY, WID_VD_TOP_DETAILS), SetMinimalSize(405, 42), SetResize(1, 0), EndContainer(),
@@ -1786,6 +1789,7 @@ static const NWidgetPart _nested_train_vehicle_details_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY, WID_VD_CAPTION), SetDataTip(STR_VEHICLE_DETAILS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_VD_RENAME_VEHICLE), SetMinimalSize(40, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_VEHICLE_NAME_BUTTON, STR_NULL /* filled in later */),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY, WID_VD_TOP_DETAILS), SetResize(1, 0), SetMinimalSize(405, 42), EndContainer(),
@@ -2234,6 +2238,7 @@ static const NWidgetPart _nested_vehicle_view_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY, WID_VV_CAPTION), SetDataTip(STR_VEHICLE_VIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_DEBUGBOX, COLOUR_GREY),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(NWID_HORIZONTAL),
diff --git a/src/viewport_gui.cpp b/src/viewport_gui.cpp
index 5a81b7978..ab8125fa1 100644
--- a/src/viewport_gui.cpp
+++ b/src/viewport_gui.cpp
@@ -28,6 +28,7 @@ static const NWidgetPart _nested_extra_view_port_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_EV_CAPTION), SetDataTip(STR_EXTRA_VIEW_PORT_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY),
diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp
index 0991fba42..d02a96057 100644
--- a/src/waypoint_gui.cpp
+++ b/src/waypoint_gui.cpp
@@ -154,6 +154,7 @@ static const NWidgetPart _nested_waypoint_view_widgets[] = {
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_W_CAPTION), SetDataTip(STR_WAYPOINT_VIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
+ NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY),
diff --git a/src/widget.cpp b/src/widget.cpp
index 72612a48e..ac7b9bc02 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -461,6 +461,18 @@ static inline void DrawStickyBox(const Rect &r, Colours colour, bool clicked)
}
/**
+ * Draw a defsize box.
+ * @param r Rectangle of the box.
+ * @param colour Colour of the defsize box.
+ * @param clicked Box is lowered.
+ */
+static inline void DrawDefSizeBox(const Rect &r, Colours colour, bool clicked)
+{
+ DrawFrameRect(r.left, r.top, r.right, r.bottom, colour, (clicked) ? FR_LOWERED : FR_NONE);
+ DrawSprite(SPR_WINDOW_DEFSIZE, PAL_NONE, r.left + WD_DEFSIZEBOX_LEFT + clicked, r.top + WD_DEFSIZEBOX_TOP + clicked);
+}
+
+/**
* Draw a NewGRF debug box.
* @param r Rectangle of the box.
* @param colour Colour of the debug box.
@@ -2042,6 +2054,7 @@ Dimension NWidgetScrollbar::horizontal_dimension = {0, 0};
Dimension NWidgetLeaf::shadebox_dimension = {0, 0};
Dimension NWidgetLeaf::debugbox_dimension = {0, 0};
+Dimension NWidgetLeaf::defsizebox_dimension = {0, 0};
Dimension NWidgetLeaf::stickybox_dimension = {0, 0};
Dimension NWidgetLeaf::resizebox_dimension = {0, 0};
Dimension NWidgetLeaf::closebox_dimension = {0, 0};
@@ -2056,7 +2069,7 @@ Dimension NWidgetLeaf::closebox_dimension = {0, 0};
*/
NWidgetLeaf::NWidgetLeaf(WidgetType tp, Colours colour, int index, uint16 data, StringID tip) : NWidgetCore(tp, colour, 1, 1, data, tip)
{
- assert(index >= 0 || tp == WWT_LABEL || tp == WWT_TEXT || tp == WWT_CAPTION || tp == WWT_RESIZEBOX || tp == WWT_SHADEBOX || tp == WWT_DEBUGBOX || tp == WWT_STICKYBOX || tp == WWT_CLOSEBOX);
+ assert(index >= 0 || tp == WWT_LABEL || tp == WWT_TEXT || tp == WWT_CAPTION || tp == WWT_RESIZEBOX || tp == WWT_SHADEBOX || tp == WWT_DEFSIZEBOX || tp == WWT_DEBUGBOX || tp == WWT_STICKYBOX || tp == WWT_CLOSEBOX);
if (index >= 0) this->SetIndex(index);
this->SetMinimalSize(0, 0);
this->SetResize(0, 0);
@@ -2114,6 +2127,12 @@ NWidgetLeaf::NWidgetLeaf(WidgetType tp, Colours colour, int index, uint16 data,
this->SetDataTip(STR_NULL, STR_TOOLTIP_DEBUG);
break;
+ case WWT_DEFSIZEBOX:
+ this->SetFill(0, 0);
+ this->SetMinimalSize(WD_DEFSIZEBOX_TOP, WD_CAPTION_HEIGHT);
+ this->SetDataTip(STR_NULL, STR_TOOLTIP_DEFSIZE);
+ break;
+
case WWT_RESIZEBOX:
this->SetFill(0, 0);
this->SetMinimalSize(WD_RESIZEBOX_WIDTH, 12);
@@ -2199,6 +2218,19 @@ void NWidgetLeaf::SetupSmallestSize(Window *w, bool init_array)
size = maxdim(size, NWidgetLeaf::stickybox_dimension);
break;
}
+
+ case WWT_DEFSIZEBOX: {
+ static const Dimension extra = {WD_DEFSIZEBOX_LEFT + WD_DEFSIZEBOX_RIGHT, WD_DEFSIZEBOX_TOP + WD_DEFSIZEBOX_BOTTOM};
+ padding = &extra;
+ if (NWidgetLeaf::defsizebox_dimension.width == 0) {
+ NWidgetLeaf::defsizebox_dimension = GetSpriteSize(SPR_WINDOW_DEFSIZE);
+ NWidgetLeaf::defsizebox_dimension.width += extra.width;
+ NWidgetLeaf::defsizebox_dimension.height += extra.height;
+ }
+ size = maxdim(size, NWidgetLeaf::defsizebox_dimension);
+ break;
+ }
+
case WWT_RESIZEBOX: {
static const Dimension extra = {WD_RESIZEBOX_LEFT + WD_RESIZEBOX_RIGHT, WD_RESIZEBOX_TOP + WD_RESIZEBOX_BOTTOM};
padding = &extra;
@@ -2397,6 +2429,11 @@ void NWidgetLeaf::Draw(const Window *w)
DrawStickyBox(r, this->colour, !!(w->flags & WF_STICKY));
break;
+ case WWT_DEFSIZEBOX:
+ assert(this->widget_data == 0);
+ DrawDefSizeBox(r, this->colour, clicked);
+ break;
+
case WWT_RESIZEBOX:
assert(this->widget_data == 0);
DrawResizeBox(r, this->colour, this->pos_x < (uint)(w->width / 2), !!(w->flags & WF_SIZING));
diff --git a/src/widget_type.h b/src/widget_type.h
index 1bd4f88fe..222983cd2 100644
--- a/src/widget_type.h
+++ b/src/widget_type.h
@@ -60,9 +60,11 @@ enum WidgetType {
WWT_FRAME, ///< Frame
WWT_CAPTION, ///< Window caption (window title between closebox and stickybox)
- WWT_SHADEBOX, ///< Shade box (at top-right of a window, between caption and stickybox)
- WWT_STICKYBOX, ///< Sticky box (normally at top-right of a window)
- WWT_DEBUGBOX, ///< NewGRF debug box (between shade box and caption)
+ WWT_DEBUGBOX, ///< NewGRF debug box (at top-right of a window, between WWT_CAPTION and WWT_SHADEBOX)
+ WWT_SHADEBOX, ///< Shade box (at top-right of a window, between WWT_DEBUGBOX and WWT_DEFSIZEBOX)
+ WWT_DEFSIZEBOX, ///< Default window size box (at top-right of a window, between WWT_SHADEBOX and WWT_STICKYBOX)
+ WWT_STICKYBOX, ///< Sticky box (at top-right of a window, after WWT_DEFSIZEBOX)
+
WWT_RESIZEBOX, ///< Resize box (normally at bottom-right of a window)
WWT_CLOSEBOX, ///< Close box (at top-left of a window)
WWT_DROPDOWN, ///< Drop down list
@@ -778,6 +780,7 @@ public:
private:
static Dimension shadebox_dimension; ///< Cached size of a shadebox widget.
static Dimension debugbox_dimension; ///< Cached size of a debugbox widget.
+ static Dimension defsizebox_dimension; ///< Cached size of a defsizebox widget.
static Dimension stickybox_dimension; ///< Cached size of a stickybox widget.
static Dimension resizebox_dimension; ///< Cached size of a resizebox widget.
static Dimension closebox_dimension; ///< Cached size of a closebox widget.
diff --git a/src/window.cpp b/src/window.cpp
index 86702842d..74628d687 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -444,6 +444,13 @@ void Window::RaiseButtons(bool autoraise)
this->SetWidgetDirty(i);
}
}
+
+ /* Special widgets without widget index */
+ NWidgetCore *wid = this->nested_root != NULL ? (NWidgetCore*)this->nested_root->GetWidgetOfType(WWT_DEFSIZEBOX) : NULL;
+ if (wid != NULL) {
+ wid->SetLowered(false);
+ wid->SetDirty(this);
+ }
}
/**
@@ -553,6 +560,24 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, int click_count)
nw->SetDirty(w);
return;
+ case WWT_DEFSIZEBOX: {
+ int16 def_width = max<int16>(min(w->window_desc->default_width, _screen.width), w->nested_root->smallest_x);
+ int16 def_height = max<int16>(min(w->window_desc->default_height, _screen.height - 50), w->nested_root->smallest_y);
+
+ int dx = (w->resize.step_width == 0) ? 0 : def_width - w->width;
+ int dy = (w->resize.step_height == 0) ? 0 : def_height - w->height;
+ /* dx and dy has to go by step.. calculate it.
+ * The cast to int is necessary else dx/dy are implicitly casted to unsigned int, which won't work. */
+ if (w->resize.step_width > 1) dx -= dx % (int)w->resize.step_width;
+ if (w->resize.step_height > 1) dy -= dy % (int)w->resize.step_height;
+ ResizeWindow(w, dx, dy, false);
+
+ nw->SetLowered(true);
+ nw->SetDirty(w);
+ w->SetTimeout();
+ break;
+ }
+
case WWT_DEBUGBOX:
w->ShowNewGRFInspectWindow();
break;
diff --git a/src/window_gui.h b/src/window_gui.h
index 45e0bad9f..4055f7caf 100644
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -106,6 +106,13 @@ enum WidgetDrawDistances {
WD_DEBUGBOX_TOP = 3, ///< Top offset of debug sprite.
WD_DEBUGBOX_BOTTOM = 3, ///< Bottom offset of debug sprite.
+ /* WWT_DEFSIZEBOX */
+ WD_DEFSIZEBOX_WIDTH = 12, ///< Width of a standard defsize box widget.
+ WD_DEFSIZEBOX_LEFT = 2, ///< Left offset of defsize sprite.
+ WD_DEFSIZEBOX_RIGHT = 2, ///< Right offset of defsize sprite.
+ WD_DEFSIZEBOX_TOP = 3, ///< Top offset of defsize sprite.
+ WD_DEFSIZEBOX_BOTTOM = 3, ///< Bottom offset of defsize sprite.
+
/* WWT_RESIZEBOX */
WD_RESIZEBOX_WIDTH = 12, ///< Width of a resize box widget.
WD_RESIZEBOX_LEFT = 3, ///< Left offset of resize sprite.