Skip to content

Commit

Permalink
GUI2: added a background for filter text boxes instead of using a 'Fi…
Browse files Browse the repository at this point in the history
…lter' label

[ci skip]
  • Loading branch information
Vultraz committed Dec 16, 2016
1 parent 0de9292 commit 0fc5ab9
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 162 deletions.
100 changes: 100 additions & 0 deletions data/gui/widget/text_box_default.cfg
Expand Up @@ -155,7 +155,107 @@

[/text_box_definition]

#define _GUI_FILTER_BOX_STUFF FONT_SIZE
[image]
x = "(width - image_width)"
y = 0
name = "(if(text = '', 'icons/action/zoomdefault_25.png~FL(horiz)', ''))"
[/image]

[text]
x = "(text_x_offset)"
y = "(text_y_offset)"
w = "(text_width)"
h = "(text_height)"
maximum_width = "(text_maximum_width)"
font_size = {GUI_NORMAL__FONT_SIZE__SMALL}
color = {GUI__FONT_COLOR_DISABLED__DEFAULT}
text = "(if(text = '', 'Search', ''))"
[/text]
#enddef

#define _GUI_RESOLUTION_FILTER RESOLUTION MIN_WIDTH DEFAULT_WIDTH HEIGHT X_OFFSET EXTRA_WIDTH FONT_SIZE BACKGROUND_ENABLED BACKGROUND_DISABLED
[resolution]

{RESOLUTION}

min_width = {MIN_WIDTH}
min_height = {HEIGHT}

default_width = {DEFAULT_WIDTH}
default_height = {HEIGHT}

max_width = 0
max_height = {HEIGHT}

text_font_size = {FONT_SIZE}
text_x_offset = {X_OFFSET}
text_y_offset = "(if(text_font_height <= height, (height - text_font_height) / 2, 0))"
text_extra_width = {EXTRA_WIDTH}

[state_enabled]

[draw]

{BACKGROUND_ENABLED}

{_GUI_DRAW_BORDER ({GUI__BORDER_COLOR_DARK}) }

{_GUI_DRAW_TEXT ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__DEFAULT}) }

{_GUI_FILTER_BOX_STUFF ({FONT_SIZE})}

[/draw]

[/state_enabled]

[state_disabled]

[draw]

{BACKGROUND_DISABLED}

{_GUI_DRAW_BORDER ({GUI__FONT_COLOR_DISABLED_DARK__DEFAULT}) }

{_GUI_DRAW_TEXT ({FONT_SIZE}) ({GUI__FONT_COLOR_DISABLED__DEFAULT}) }

{_GUI_FILTER_BOX_STUFF ({FONT_SIZE})}

[/draw]

[/state_disabled]

[state_focused]

[draw]

{BACKGROUND_ENABLED}

{_GUI_DRAW_BORDER ({GUI__BORDER_COLOR}) }

{_GUI_DRAW_TEXT ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__DEFAULT}) }

{_GUI_DRAW_CURSOR ({X_OFFSET}) }

[/draw]

[/state_focused]

[/resolution]

#enddef

[text_box_definition]
id = "filter"
description = "Filter text box"

{_GUI_RESOLUTION_FILTER () 40 250 25 5 10 ({GUI_NORMAL__FONT_SIZE__DEFAULT}) ({_GUI_TEXTBOX_BACKGROUND_ENABLED}) ({_GUI_TEXTBOX_BACKGROUND_DISABLED})}

[/text_box_definition]

#undef _GUI_RESOLUTION
#undef _GUI_RESOLUTION_FILTER
#undef _GUI_FILTER_BOX_STUFF
#undef _GUI_DRAW_CURSOR
#undef _GUI_DRAW_TEXT
#undef _GUI_DRAW_BORDER
Expand Down
15 changes: 1 addition & 14 deletions data/gui/window/addon_list.cfg
Expand Up @@ -1027,19 +1027,6 @@
[row]
grow_factor = 1

[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "left"

[label]
definition = "default"

label = "Filter:"
[/label]
[/column]

[column]
grow_factor = 0
border = "all"
Expand All @@ -1048,7 +1035,7 @@

[text_box]
id = "filter"
definition = "default"
definition = "filter"

tooltip = "Filters on addon descripton, version, type or author."
[/text_box]
Expand Down
13 changes: 1 addition & 12 deletions data/gui/window/chat_log.cfg
Expand Up @@ -122,25 +122,14 @@

[/column]

[column]
grow_factor = 0
border = "all"
border_size = 5

[label]
definition = "default"
label = _ "Filter:"
[/label]
[/column]

[column]
grow_factor = 0
border = "all"
border_size = 5

[text_box]
id = "filter"
definition = "default"
definition = "filter"
[/text_box]
[/column]

Expand Down
39 changes: 6 additions & 33 deletions data/gui/window/game_load.cfg
Expand Up @@ -239,41 +239,14 @@
grow_factor = 0

[column]
border = "all"
border_size = 5
horizontal_alignment = "left"

[grid]

[row]
grow_factor = 1

[column]
border = "all"
border_size = 5
vertical_alignment = "center"

[label]
id = "lblFilter"
definition = "default"

label = _ "Filter"
[/label]

[/column]

[column]
border = "all"
border_size = 5

[text_box]
id = "txtFilter"
definition = "default"
[/text_box]

[/column]

[/row]

[/grid]
[text_box]
id = "txtFilter"
definition = "filter"
[/text_box]

[/column]

Expand Down
11 changes: 1 addition & 10 deletions data/gui/window/lobby_main.cfg
Expand Up @@ -457,22 +457,13 @@
#define _GUI_FILTER_AREA
[grid]
[row]
[column]
grow_factor = 0
border = "all"
border_size = 5
[label]
definition = "default"
label = _ "Filter:"
[/label]
[/column]
[column]
grow_factor = 0
horizontal_grow = "true"
border = "all"
border_size = 5
[text_box]
definition = "default"
definition = "filter"
id = "filter_text"
[/text_box]
[/column]
Expand Down
46 changes: 16 additions & 30 deletions data/gui/window/mp_create_game.cfg
Expand Up @@ -645,41 +645,27 @@

[column]
grow_factor = 1
horizontal_grow = "true"

[grid]

[row]
grow_factor = 0

[column]
grow_factor = 0

border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"

label = _ "Filter:"
[/label]

[/column]
border = "all"
border_size = 5
horizontal_grow = "true"
[text_box]
id = "game_filter"
definition = "filter"
[/text_box]

[column]
grow_factor = 1
[/column]

border = "all"
border_size = 5
horizontal_grow = "true"
[text_box]
id = "game_filter"
definition = "default"
[/text_box]
[/row]

[row]
grow_factor = 0

[/column]
[column]
grow_factor = 1
horizontal_grow = "true"

[/row]
[grid]

[row]
grow_factor = 0
Expand Down
37 changes: 6 additions & 31 deletions data/gui/window/unit_create.cfg
Expand Up @@ -84,39 +84,14 @@
[row]

[column]
border = "all"
border_size = 5
horizontal_alignment = "left"

[grid]

[row]
grow_factor = 1

[column]
border = "all"
border_size = 5
vertical_alignment = "center"

[label]
definition = "default"
label = _ "Filter"
[/label]

[/column]

[column]
border = "all"
border_size = 5

[text_box]
id = "filter_box"
definition = "default"
[/text_box]

[/column]

[/row]

[/grid]
[text_box]
id = "filter_box"
definition = "filter"
[/text_box]

[/column]

Expand Down
38 changes: 6 additions & 32 deletions data/gui/window/unit_recall.cfg
Expand Up @@ -331,40 +331,14 @@
grow_factor = 0

[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"

[grid]

[row]
grow_factor = 1

[column]
border = "all"
border_size = 5
vertical_alignment = "center"

[label]
definition = "default"
label = _ "Filter"
[/label]

[/column]

[column]
border = "all"
border_size = 5

[text_box]
id = "filter_box"
definition = "default"
[/text_box]

[/column]

[/row]

[/grid]
[text_box]
id = "filter_box"
definition = "filter"
[/text_box]

[/column]

Expand Down

0 comments on commit 0fc5ab9

Please sign in to comment.