Skip to content

Commit

Permalink
Draw a border around the lobby game list
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Mar 26, 2016
1 parent e7d82eb commit f81169b
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 34 deletions.
102 changes: 70 additions & 32 deletions data/gui/macros/_initial.cfg
Expand Up @@ -130,7 +130,47 @@

#enddef

# Forces a wiget to be of a certain size.
#define GUI__LAYER_GRID WIDGET
[layer]
[row]
grow_factor = 1
[column]
grow_factor = 1
horizontal_grow = "true"
vertical_grow = "true"
{WIDGET}
[/column]
[/row]
[/layer]
#enddef
#define GUI__WIDGET_BORDER_LAYER MARGIN THICKNESS COLOR
{GUI__LAYER_GRID (
[drawing]
[draw]
[rectangle]
x = 0
y = 0
w = "(width-4)"
h = "(height-4)"

border_thickness = 1
border_color = {COLOR}
[/rectangle]
[/draw]
[/drawing]
)}
#enddef
#define GUI__WIDGET_FORCE_SIZE_LAYER WIDTH HEIGHT
{GUI__LAYER_GRID (
[spacer]
definition = "default"
width = "{WIDTH}"
height = "{HEIGHT}"
[/spacer]
)}
#enddef

# Forces a widget to be of a certain size.
# Depending of the flags of the parent widget the item will grow
#
# WIDTH Minimum width for the widget.
Expand All @@ -157,42 +197,40 @@
definition = "default"

[stack]
{GUI__WIDGET_FORCE_SIZE_LAYER {WIDTH} {HEIGHT}}
{GUI__LAYER_GRID {WIDGET}}
[/stack]
[/stacked_widget]
#enddef

[layer]

[row]

[column]

[spacer]
definition = "default"
width = "{WIDTH}"
height = "{HEIGHT}"
[/spacer]

[/column]

[/row]

[/layer]

[layer]

[row]
grow_factor = 1
[column]
grow_factor = 1
horizontal_grow = "true"
vertical_grow = "true"
{WIDGET}
[/column]
# Draws a border around a widget.
# Depending on the flags of the parent widget, the item will grow
#
# MARGIN The border size of the grid's column
# THICKNESS The thickness of the border.
# COLOR The border's color.
# WIDGET The widget to add into the item.
#define GUI_OUTLINED_WIDGET MARGIN THICKNESS COLOR WIDGET
[stacked_widget]
definition = "default"

[/row]
[stack]
{GUI__WIDGET_BORDER_LAYER {MARGIN} {THICKNESS} {COLOR}}
{GUI__LAYER_GRID {WIDGET}}
[/stack]
[/stacked_widget]
#enddef

[/layer]
# Combines GUI_FORCE_WIDGET_MINIMUM_SIZE and GUI_OUTLINED_WIDGET
#define GUI_FORCE_OUTLINED_WIDGET_MINIMUM_SIZE WIDTH HEIGHT MARGIN THICKNESS COLOR WIDGET
[stacked_widget]
definition = "default"

[stack]
{GUI__WIDGET_FORCE_SIZE_LAYER {WIDTH} {HEIGHT}}
{GUI__WIDGET_BORDER_LAYER {MARGIN} {THICKNESS} {COLOR}}
{GUI__LAYER_GRID {WIDGET}}
[/stack]

[/stacked_widget]
#enddef

Expand Down
6 changes: 4 additions & 2 deletions data/gui/window/lobby_main.cfg
Expand Up @@ -102,7 +102,7 @@
#enddef

#define GAMELISTBOX
border = "left"
border = "all"
border_size = 5

[listbox]
Expand Down Expand Up @@ -794,7 +794,9 @@ border_size = 5
[column]
horizontal_grow = "true"
vertical_grow = "true"
{GUI_FORCE_WIDGET_MINIMUM_SIZE 0 "((screen_height * 30) / 100)" (
{GUI_FORCE_OUTLINED_WIDGET_MINIMUM_SIZE
0 "((screen_height * 30) / 100)"
5 1 {GUI__BORDER_COLOR_BRIGHT} (
{GAMELISTBOX}
)}
[/column]
Expand Down

0 comments on commit f81169b

Please sign in to comment.