GUI2: converted horizontal scrollbars to new style

This commit is contained in:
Charles Dang 2016-04-09 01:03:40 +11:00
parent 547bf2f1df
commit 9cc4834070
11 changed files with 21 additions and 37 deletions

View file

@ -13,7 +13,7 @@ horizontal_grow = "true"
# note we want a special button definition for this later.
[repeating_button]
id = "_half_page_up"
definition = "left_arrow"
definition = "scrollbar_left_arrow"
[/repeating_button]
[/column]
@ -34,7 +34,7 @@ horizontal_grow = "true"
# note we want a special button definition for this later.
[repeating_button]
id = "_half_page_down"
definition = "right_arrow"
definition = "scrollbar_right_arrow"
[/repeating_button]
[/column]

View file

@ -3,43 +3,27 @@
### Definition of a horizontal scrollbar.
###
#define _GUI_STATE GROOVE_LEFT GROOVE_RIGHT POSITIONER_LEFT POSITIONER_RIGHT IMAGE_SUFFIX IPF
#define _GUI_STATE POSITIONER_LEFT IMAGE_SUFFIX IPF
[draw]
#
# Groove
#
[image]
# 4 pixels wide
[rectangle]
x = 0
y = 0
name = "buttons/scrollbars/scrollgroove-left.png{IPF}"
[/image]
[image]
x = {GROOVE_LEFT}
y = 0
w = "(if(width - {GROOVE_LEFT} - {GROOVE_RIGHT} < 0
, 0, width - {GROOVE_LEFT} - {GROOVE_RIGHT}))"
h = 0
resize_mode = "stretch"
name = "buttons/scrollbars/scrollgroove-horizontal.png{IPF}"
[/image]
[image]
# 5 pixels wide
x = "(width - {GROOVE_RIGHT})"
y = 0
name = "buttons/scrollbars/scrollgroove-right.png{IPF}"
[/image]
w = "(width)"
h = "(height)"
fill_color = "4, 4, 4, 255"
[/rectangle]
#
# Positioner
#
[image]
# 5 pixels wide
# 5 pixels high
x = "(positioner_offset)"
y = 0
name = "buttons/scrollbars/scrollleft{IMAGE_SUFFIX}{IPF}"
@ -49,15 +33,15 @@
x = "(positioner_offset + {POSITIONER_LEFT})"
y = 0
w = "(
if(positioner_length - {POSITIONER_LEFT} - {POSITIONER_RIGHT} < 0
, 0, positioner_length - {POSITIONER_LEFT} - {POSITIONER_RIGHT}))"
if(positioner_length - {POSITIONER_LEFT} < 0
, 0, positioner_length - {POSITIONER_LEFT}))"
resize_mode = "stretch"
name = "buttons/scrollbars/scrollhorizontal{IMAGE_SUFFIX}{IPF}"
[/image]
[image]
# 5 pixels wide
x = "(positioner_offset + positioner_length - {POSITIONER_RIGHT})"
# 5 pixels high
x = "(positioner_offset + positioner_length)"
y = 0
name = "buttons/scrollbars/scrollright{IMAGE_SUFFIX}{IPF}"
[/image]
@ -65,7 +49,7 @@ if(positioner_length - {POSITIONER_LEFT} - {POSITIONER_RIGHT} < 0
[/draw]
#enddef
#define _GUI_RESOLUTION RESOLUTION WIDTH HEIGHT POSITIONER_LENGHT GROOVE_LEFT GROOVE_RIGHT POSITIONER_LEFT POSITIONER_RIGHT IPF
#define _GUI_RESOLUTION RESOLUTION WIDTH HEIGHT POSITIONER_LENGHT POSITIONER_LEFT IPF
[resolution]
{RESOLUTION}
@ -74,7 +58,7 @@ if(positioner_length - {POSITIONER_LEFT} - {POSITIONER_RIGHT} < 0
min_height = {HEIGHT}
default_width = {WIDTH}
default_height = {HEIGHT}
default_height = 15
max_width = 0
max_height = {HEIGHT}
@ -85,19 +69,19 @@ if(positioner_length - {POSITIONER_LEFT} - {POSITIONER_RIGHT} < 0
right_offset = 0
[state_enabled]
{_GUI_STATE ({GROOVE_LEFT}) ({GROOVE_RIGHT}) ({POSITIONER_LEFT}) ({POSITIONER_RIGHT}) ".png" ({IPF}) }
{_GUI_STATE ({POSITIONER_LEFT}) ".png" ({IPF}) }
[/state_enabled]
[state_disabled]
{_GUI_STATE ({GROOVE_LEFT}) ({GROOVE_RIGHT}) ({POSITIONER_LEFT}) ({POSITIONER_RIGHT}) ".png~GS()" ({IPF}) }
{_GUI_STATE ({POSITIONER_LEFT}) ".png~GS()" ({IPF}) }
[/state_disabled]
[state_pressed]
{_GUI_STATE ({GROOVE_LEFT}) ({GROOVE_RIGHT}) ({POSITIONER_LEFT}) ({POSITIONER_RIGHT}) "-pressed.png" ({IPF}) }
{_GUI_STATE ({POSITIONER_LEFT}) "-pressed.png" ({IPF}) }
[/state_pressed]
[state_focused]
{_GUI_STATE ({GROOVE_LEFT}) ({GROOVE_RIGHT}) ({POSITIONER_LEFT}) ({POSITIONER_RIGHT}) "-active.png" ({IPF}) }
{_GUI_STATE ({POSITIONER_LEFT}) "-active.png" ({IPF}) }
[/state_focused]
[/resolution]
#enddef
@ -109,7 +93,7 @@ if(positioner_length - {POSITIONER_LEFT} - {POSITIONER_RIGHT} < 0
# Note a scrollbar is normally sized by the item that "masters" it
# that's why the default height is rather low.
{_GUI_RESOLUTION () 20 25 11 4 5 5 5 ()}
{_GUI_RESOLUTION () 20 25 11 2 ()}
[/horizontal_scrollbar_definition]
@ -120,7 +104,7 @@ if(positioner_length - {POSITIONER_LEFT} - {POSITIONER_RIGHT} < 0
# Note a scrollbar is normally sized by the item that "masters" it
# that's why the default height is rather low.
{_GUI_RESOLUTION () 20 25 11 4 5 5 5 "~O(65%)"}
{_GUI_RESOLUTION () 20 25 11 5 "~O(65%)"}
[/horizontal_scrollbar_definition]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 B

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 B

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 B

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 B

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 B

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 B

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 B

After

Width:  |  Height:  |  Size: 173 B