Skip to content

Commit

Permalink
Revert "GUI2: removed GUI_FORCE_WIDGET_SIZE macro in favor of fixed_w…
Browse files Browse the repository at this point in the history
…idth/fixed_height keys"

This reverts commit 9f386ed.

fixed_width/fixed_height are broken and completely fail to block the
widget from growing.
  • Loading branch information
jyrkive committed Nov 15, 2017
1 parent 84e2053 commit 18e208e
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 42 deletions.
18 changes: 18 additions & 0 deletions data/gui/macros/_initial.cfg
Expand Up @@ -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
Expand Down
59 changes: 30 additions & 29 deletions data/gui/window/lobby_main.cfg
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down
11 changes: 6 additions & 5 deletions data/gui/window/mp_join_game.cfg
Expand Up @@ -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"
Expand Down Expand Up @@ -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]
Expand Down
18 changes: 10 additions & 8 deletions data/gui/window/mp_staging.cfg
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 18e208e

Please sign in to comment.