From 9f386ed563e84e355130a940be804d13bf5b3d9c Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Sat, 11 Nov 2017 23:12:14 +1100 Subject: [PATCH] GUI2: removed GUI_FORCE_WIDGET_SIZE macro in favor of fixed_width/fixed_height keys [ci skip] --- data/gui/macros/_initial.cfg | 18 ---------- data/gui/window/lobby_main.cfg | 59 ++++++++++++++++---------------- data/gui/window/mp_join_game.cfg | 11 +++--- data/gui/window/mp_staging.cfg | 18 +++++----- 4 files changed, 42 insertions(+), 64 deletions(-) diff --git a/data/gui/macros/_initial.cfg b/data/gui/macros/_initial.cfg index d5837a7127ad..3ca6d24586f0 100644 --- a/data/gui/macros/_initial.cfg +++ b/data/gui/macros/_initial.cfg @@ -222,24 +222,6 @@ [/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 7aa2bf743ed2..f3d61f0affdb 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 - {GUI_FORCE_WIDGET_SIZE 0 "((screen_height * 20) / 100)" ( - [grid] - [row] - grow_factor = 1 + [grid] + fixed_height = "((screen_height * 20) / 100)" - [column] - grow_factor = 1 - horizontal_grow = true - vertical_grow = true + [row] + grow_factor = 1 - [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,11 +883,10 @@ horizontal_grow = true vertical_grow = true - {GUI_FORCE_WIDGET_SIZE 0 "((screen_height * 25 / 100))" ( - [chatbox] - id = "chat" - [/chatbox] - )} + [chatbox] + id = "chat" + fixed_height = "((screen_height * 25 / 100))" + [/chatbox] [/column] [/row] [/grid] diff --git a/data/gui/window/mp_join_game.cfg b/data/gui/window/mp_join_game.cfg index a5190df24378..000dd480260e 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,11 +558,10 @@ horizontal_grow = true vertical_grow = true - {GUI_FORCE_WIDGET_SIZE 0 "((screen_height * 25 / 100))" ( - [chatbox] - id = "chat" - [/chatbox] - )} + [chatbox] + id = "chat" + fixed_height = "((screen_height * 25 / 100))" + [/chatbox] [/column] [/row] diff --git a/data/gui/window/mp_staging.cfg b/data/gui/window/mp_staging.cfg index 127629172593..9e4d34dcf443 100644 --- a/data/gui/window/mp_staging.cfg +++ b/data/gui/window/mp_staging.cfg @@ -707,11 +707,10 @@ horizontal_grow = true vertical_grow = true - {GUI_FORCE_WIDGET_SIZE 0 "((screen_height * 25 / 100))" ( - [chatbox] - id = "chat" - [/chatbox] - )} + [chatbox] + id = "chat" + fixed_height = "((screen_height * 25 / 100))" + [/chatbox] [/column] [column] @@ -882,11 +881,10 @@ horizontal_grow = true vertical_grow = true - {GUI_FORCE_WIDGET_SIZE 0 "((screen_height * 25 / 100))" ( - [chatbox] - id = "chat" - [/chatbox] - )} + [chatbox] + id = "chat" + fixed_height = "((screen_height * 25 / 100))" + [/chatbox] [/column] [/row]