diff --git a/data/gui/macros/_initial.cfg b/data/gui/macros/_initial.cfg index 3ca6d24586f0..d5837a7127ad 100644 --- a/data/gui/macros/_initial.cfg +++ b/data/gui/macros/_initial.cfg @@ -222,6 +222,24 @@ [/stacked_widget] #enddef +# Forces a widget to be of a certain size and blocks it from growing. +# +# WIDTH Width for the widget. +# HEIGHT Height for the widget. +# WIDGET The widget to add to the item. +# +#define GUI_FORCE_WIDGET_SIZE WIDTH HEIGHT WIDGET + [size_lock] + definition = "default" + width = "{WIDTH}" + height = "{HEIGHT}" + + [widget] + {WIDGET} + [/widget] + [/size_lock] +#enddef + #define GUI_WINDOW_FULLSCREEN automatic_placement = false x = 0 diff --git a/data/gui/window/lobby_main.cfg b/data/gui/window/lobby_main.cfg index f3d61f0affdb..7aa2bf743ed2 100644 --- a/data/gui/window/lobby_main.cfg +++ b/data/gui/window/lobby_main.cfg @@ -764,35 +764,35 @@ horizontal_grow = true vertical_grow = true - [grid] - fixed_height = "((screen_height * 20) / 100)" - - [row] - grow_factor = 1 - - [column] + {GUI_FORCE_WIDGET_SIZE 0 "((screen_height * 20) / 100)" ( + [grid] + [row] grow_factor = 1 - horizontal_grow = true - vertical_grow = true - [chatbox] - id = "chat" - [/chatbox] - [/column] + [column] + grow_factor = 1 + horizontal_grow = true + vertical_grow = true - [column] - grow_factor = 0 - border = "top" - border_size = 5 - horizontal_grow = true - vertical_grow = true + [chatbox] + id = "chat" + [/chatbox] + [/column] - [grid] - {_GUI_PLAYER_TREE_AREA} - [/grid] - [/column] - [/row] - [/grid] + [column] + grow_factor = 0 + border = "top" + border_size = 5 + horizontal_grow = true + vertical_grow = true + + [grid] + {_GUI_PLAYER_TREE_AREA} + [/grid] + [/column] + [/row] + [/grid] + )} [/column] [/row] [/grid] @@ -883,10 +883,11 @@ horizontal_grow = true vertical_grow = true - [chatbox] - id = "chat" - fixed_height = "((screen_height * 25 / 100))" - [/chatbox] + {GUI_FORCE_WIDGET_SIZE 0 "((screen_height * 25 / 100))" ( + [chatbox] + id = "chat" + [/chatbox] + )} [/column] [/row] [/grid] diff --git a/data/gui/window/mp_join_game.cfg b/data/gui/window/mp_join_game.cfg index 000dd480260e..a5190df24378 100644 --- a/data/gui/window/mp_join_game.cfg +++ b/data/gui/window/mp_join_game.cfg @@ -411,7 +411,7 @@ # This is exactly the size of two large-sized buttons (116 x 2) plus the interior # border space between them (10). It keeps this column the same size as the corresponding # one in MP Staging, which has the above layout (2 buttons, etc). - {GUI_FORCE_WIDGET_MINIMUM_SIZE 242 0 ( + {GUI_FORCE_WIDGET_MINIMUM_SIZE 242 0 ( [button] id = "cancel" definition = "large" @@ -558,10 +558,11 @@ horizontal_grow = true vertical_grow = true - [chatbox] - id = "chat" - fixed_height = "((screen_height * 25 / 100))" - [/chatbox] + {GUI_FORCE_WIDGET_SIZE 0 "((screen_height * 25 / 100))" ( + [chatbox] + id = "chat" + [/chatbox] + )} [/column] [/row] diff --git a/data/gui/window/mp_staging.cfg b/data/gui/window/mp_staging.cfg index 9e4d34dcf443..127629172593 100644 --- a/data/gui/window/mp_staging.cfg +++ b/data/gui/window/mp_staging.cfg @@ -707,10 +707,11 @@ horizontal_grow = true vertical_grow = true - [chatbox] - id = "chat" - fixed_height = "((screen_height * 25 / 100))" - [/chatbox] + {GUI_FORCE_WIDGET_SIZE 0 "((screen_height * 25 / 100))" ( + [chatbox] + id = "chat" + [/chatbox] + )} [/column] [column] @@ -881,10 +882,11 @@ horizontal_grow = true vertical_grow = true - [chatbox] - id = "chat" - fixed_height = "((screen_height * 25 / 100))" - [/chatbox] + {GUI_FORCE_WIDGET_SIZE 0 "((screen_height * 25 / 100))" ( + [chatbox] + id = "chat" + [/chatbox] + )} [/column] [/row]