New design for vertical scrollbars (horizontal pending)
@ -29,7 +29,7 @@
|
|||||||
# If the text is too high it returns the top side.
|
# If the text is too high it returns the top side.
|
||||||
# Rounding happens to the bottom side.
|
# Rounding happens to the bottom side.
|
||||||
#define GUI__TEXT_VERTICALLY_CENTRED
|
#define GUI__TEXT_VERTICALLY_CENTRED
|
||||||
"(if(text_height < height, (height - text_height + 1) / 2, 0))"
|
"(if(text_height < height, (height - text_height - 2) / 2, 0))"
|
||||||
#enddef
|
#enddef
|
||||||
|
|
||||||
#define GUI__CENTERED_TEXT FONT_SIZE FONT_STYLE FONT_COLOR
|
#define GUI__CENTERED_TEXT FONT_SIZE FONT_STYLE FONT_COLOR
|
||||||
@ -291,21 +291,21 @@
|
|||||||
#enddef
|
#enddef
|
||||||
|
|
||||||
#define GUI_NORMAL__FONT_SIZE__TINY
|
#define GUI_NORMAL__FONT_SIZE__TINY
|
||||||
10
|
13
|
||||||
#enddef
|
#enddef
|
||||||
|
|
||||||
#define GUI_NORMAL__FONT_SIZE__SMALL
|
#define GUI_NORMAL__FONT_SIZE__SMALL
|
||||||
12
|
15
|
||||||
#enddef
|
#enddef
|
||||||
|
|
||||||
#define GUI_NORMAL__FONT_SIZE__DEFAULT
|
#define GUI_NORMAL__FONT_SIZE__DEFAULT
|
||||||
14
|
17
|
||||||
#enddef
|
#enddef
|
||||||
|
|
||||||
#define GUI_NORMAL__FONT_SIZE__LARGE
|
#define GUI_NORMAL__FONT_SIZE__LARGE
|
||||||
18
|
20
|
||||||
#enddef
|
#enddef
|
||||||
|
|
||||||
#define GUI_NORMAL__FONT_SIZE__TITLE
|
#define GUI_NORMAL__FONT_SIZE__TITLE
|
||||||
20
|
24
|
||||||
#enddef
|
#enddef
|
||||||
|
@ -13,7 +13,7 @@ vertical_grow = "true"
|
|||||||
# note we want a special button definition for this later.
|
# note we want a special button definition for this later.
|
||||||
[repeating_button]
|
[repeating_button]
|
||||||
id = "_half_page_up"
|
id = "_half_page_up"
|
||||||
definition = "up_arrow"
|
definition = "scrollbar_up_arrow"
|
||||||
[/repeating_button]
|
[/repeating_button]
|
||||||
|
|
||||||
[/column]
|
[/column]
|
||||||
@ -22,7 +22,8 @@ vertical_grow = "true"
|
|||||||
|
|
||||||
[row]
|
[row]
|
||||||
|
|
||||||
grow_factor = 1
|
grow_factor = 1
|
||||||
|
|
||||||
[column]
|
[column]
|
||||||
vertical_grow = "true"
|
vertical_grow = "true"
|
||||||
|
|
||||||
@ -42,7 +43,7 @@ vertical_grow = "true"
|
|||||||
# note we want a special button definition for this later.
|
# note we want a special button definition for this later.
|
||||||
[repeating_button]
|
[repeating_button]
|
||||||
id = "_half_page_down"
|
id = "_half_page_down"
|
||||||
definition = "down_arrow"
|
definition = "scrollbar_down_arrow"
|
||||||
[/repeating_button]
|
[/repeating_button]
|
||||||
|
|
||||||
[/column]
|
[/column]
|
||||||
|
@ -157,22 +157,6 @@
|
|||||||
|
|
||||||
# Transparent arrow buttons
|
# Transparent arrow buttons
|
||||||
|
|
||||||
{_GUI_DEFINITION
|
|
||||||
"down_arrow_transparent"
|
|
||||||
"Down arrow button for a transparent scrollbar."
|
|
||||||
"buttons/button_square/button_square_25"
|
|
||||||
"icons/arrows/arrows_ornate_down_25"
|
|
||||||
"~O(65%)"
|
|
||||||
}
|
|
||||||
|
|
||||||
{_GUI_DEFINITION
|
|
||||||
"up_arrow_transparent"
|
|
||||||
"Up arrow button for a transparent scrollbar."
|
|
||||||
"buttons/button_square/button_square_25"
|
|
||||||
"icons/arrows/arrows_ornate_up_25"
|
|
||||||
"~O(65%)"
|
|
||||||
}
|
|
||||||
|
|
||||||
{_GUI_DEFINITION
|
{_GUI_DEFINITION
|
||||||
"left_arrow_transparent"
|
"left_arrow_transparent"
|
||||||
"Left arrow button for a transparent scrollbar."
|
"Left arrow button for a transparent scrollbar."
|
||||||
@ -191,4 +175,3 @@
|
|||||||
|
|
||||||
#undef _GUI_DEFINITION
|
#undef _GUI_DEFINITION
|
||||||
#undef _GUI_RESOLUTION
|
#undef _GUI_RESOLUTION
|
||||||
|
|
||||||
|
190
data/gui/widget/repeating_button_scrollbar.cfg
Normal file
@ -0,0 +1,190 @@
|
|||||||
|
#textdomain wesnoth-lib
|
||||||
|
###
|
||||||
|
### Definition of repeating buttons for scrollbar arrows
|
||||||
|
###
|
||||||
|
|
||||||
|
#define _GUI_RESOLUTION RESOLUTION SIZE IMAGE_OVERLAY IPF ALPHA
|
||||||
|
[resolution]
|
||||||
|
|
||||||
|
{RESOLUTION}
|
||||||
|
|
||||||
|
min_width = {SIZE}
|
||||||
|
min_height = {SIZE}
|
||||||
|
|
||||||
|
default_width = {SIZE}
|
||||||
|
default_height = {SIZE}
|
||||||
|
|
||||||
|
max_width = {SIZE}
|
||||||
|
max_height = {SIZE}
|
||||||
|
|
||||||
|
[state_enabled]
|
||||||
|
|
||||||
|
[draw]
|
||||||
|
|
||||||
|
[rectangle]
|
||||||
|
x = 0
|
||||||
|
y = 0
|
||||||
|
w = "(width)"
|
||||||
|
h = "(height)"
|
||||||
|
fill_color = "4, 4, 4, {ALPHA}"
|
||||||
|
[/rectangle]
|
||||||
|
|
||||||
|
[image]
|
||||||
|
w = {SIZE}
|
||||||
|
h = {SIZE}
|
||||||
|
name = {IMAGE_OVERLAY} + ".png{IPF}"
|
||||||
|
[/image]
|
||||||
|
|
||||||
|
[/draw]
|
||||||
|
|
||||||
|
[/state_enabled]
|
||||||
|
|
||||||
|
[state_disabled]
|
||||||
|
|
||||||
|
[draw]
|
||||||
|
|
||||||
|
[rectangle]
|
||||||
|
x = 0
|
||||||
|
y = 0
|
||||||
|
w = "(width)"
|
||||||
|
h = "(height)"
|
||||||
|
fill_color = "4, 4, 4, {ALPHA}"
|
||||||
|
[/rectangle]
|
||||||
|
|
||||||
|
[image]
|
||||||
|
w = {SIZE}
|
||||||
|
h = {SIZE}
|
||||||
|
name = {IMAGE_OVERLAY} + ".png~GS(){IPF}"
|
||||||
|
[/image]
|
||||||
|
|
||||||
|
[/draw]
|
||||||
|
|
||||||
|
[/state_disabled]
|
||||||
|
|
||||||
|
[state_pressed]
|
||||||
|
|
||||||
|
[draw]
|
||||||
|
|
||||||
|
[rectangle]
|
||||||
|
x = 0
|
||||||
|
y = 0
|
||||||
|
w = "(width)"
|
||||||
|
h = "(height)"
|
||||||
|
fill_color = "4, 4, 4, {ALPHA}"
|
||||||
|
[/rectangle]
|
||||||
|
|
||||||
|
[image]
|
||||||
|
w = {SIZE}
|
||||||
|
h = {SIZE}
|
||||||
|
name = {IMAGE_OVERLAY} + "-pressed.png{IPF}"
|
||||||
|
[/image]
|
||||||
|
|
||||||
|
[/draw]
|
||||||
|
|
||||||
|
[/state_pressed]
|
||||||
|
|
||||||
|
[state_focused]
|
||||||
|
|
||||||
|
[draw]
|
||||||
|
|
||||||
|
[rectangle]
|
||||||
|
x = 0
|
||||||
|
y = 0
|
||||||
|
w = "(width)"
|
||||||
|
h = "(height)"
|
||||||
|
fill_color = "4, 4, 4, {ALPHA}"
|
||||||
|
[/rectangle]
|
||||||
|
|
||||||
|
[image]
|
||||||
|
w = {SIZE}
|
||||||
|
h = {SIZE}
|
||||||
|
name = {IMAGE_OVERLAY} + "-active.png{IPF}"
|
||||||
|
[/image]
|
||||||
|
|
||||||
|
[/draw]
|
||||||
|
|
||||||
|
[/state_focused]
|
||||||
|
|
||||||
|
[/resolution]
|
||||||
|
#enddef
|
||||||
|
|
||||||
|
#define _GUI_DEFINITION ID DESCRIPTION IMAGE_OVERLAY IPF ALPHA
|
||||||
|
[repeating_button_definition]
|
||||||
|
id = {ID}
|
||||||
|
description = {DESCRIPTION}
|
||||||
|
|
||||||
|
{_GUI_RESOLUTION () 15 ({IMAGE_OVERLAY}) ({IPF}) ({ALPHA})}
|
||||||
|
|
||||||
|
[/repeating_button_definition]
|
||||||
|
#enddef
|
||||||
|
|
||||||
|
{_GUI_DEFINITION
|
||||||
|
"scrollbar_up_arrow"
|
||||||
|
"Up arrow button for a scrollbar."
|
||||||
|
"icons/arrows/short_arrow_right_25"
|
||||||
|
("~CROP(4,4,17,17)~ROTATE(-90)")
|
||||||
|
"255"
|
||||||
|
}
|
||||||
|
|
||||||
|
{_GUI_DEFINITION
|
||||||
|
"scrollbar_down_arrow"
|
||||||
|
"Down arrow button for a scrollbar."
|
||||||
|
"icons/arrows/short_arrow_right_25"
|
||||||
|
("~CROP(4,4,17,17)~ROTATE(90)")
|
||||||
|
"255"
|
||||||
|
}
|
||||||
|
|
||||||
|
{_GUI_DEFINITION
|
||||||
|
"scrollbar_left_arrow"
|
||||||
|
"Up arrow button for a scrollbar."
|
||||||
|
"icons/arrows/short_arrow_right_25"
|
||||||
|
("~CROP(4,4,17,17)~ROTATE(180)")
|
||||||
|
"255"
|
||||||
|
}
|
||||||
|
|
||||||
|
{_GUI_DEFINITION
|
||||||
|
"scrollbar_right_arrow"
|
||||||
|
"Down arrow button for a scrollbar."
|
||||||
|
"icons/arrows/short_arrow_right_25"
|
||||||
|
("~CROP(4,4,17,17)")
|
||||||
|
"255"
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Transparent versions
|
||||||
|
#
|
||||||
|
|
||||||
|
{_GUI_DEFINITION
|
||||||
|
"scrollbar_up_arrow_transparent"
|
||||||
|
"Up arrow button for a scrollbar."
|
||||||
|
"icons/arrows/short_arrow_right_25"
|
||||||
|
("~CROP(4,4,17,17)~ROTATE(-90)~O(65%)")
|
||||||
|
"165"
|
||||||
|
}
|
||||||
|
|
||||||
|
{_GUI_DEFINITION
|
||||||
|
"scrollbar_down_arrow_transparent"
|
||||||
|
"Down arrow button for a scrollbar."
|
||||||
|
"icons/arrows/short_arrow_right_25"
|
||||||
|
("~CROP(4,4,17,17)~ROTATE(90)~O(65%)")
|
||||||
|
"165"
|
||||||
|
}
|
||||||
|
|
||||||
|
{_GUI_DEFINITION
|
||||||
|
"scrollbar_left_arrow_transparent"
|
||||||
|
"Up arrow button for a scrollbar."
|
||||||
|
"icons/arrows/short_arrow_right_25"
|
||||||
|
("~CROP(4,4,17,17)~ROTATE(180)~O(65%)")
|
||||||
|
"165"
|
||||||
|
}
|
||||||
|
|
||||||
|
{_GUI_DEFINITION
|
||||||
|
"scrollbar_right_arrow_transparent"
|
||||||
|
"Down arrow button for a scrollbar."
|
||||||
|
"icons/arrows/short_arrow_right_25"
|
||||||
|
("~CROP(4,4,17,17)~O(65%)")
|
||||||
|
"165"
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef _GUI_DEFINITION
|
||||||
|
#undef _GUI_RESOLUTION
|
@ -3,35 +3,20 @@
|
|||||||
### Definition of a vertical scrollbar.
|
### Definition of a vertical scrollbar.
|
||||||
###
|
###
|
||||||
|
|
||||||
#define _GUI_STATE GROOVE_TOP GROOVE_BOTTOM POSITIONER_TOP POSITIONER_BOTTOM IMAGE_SUFFIX IPF
|
#define _GUI_STATE POSITIONER_TOP IMAGE_SUFFIX IPF
|
||||||
[draw]
|
[draw]
|
||||||
|
|
||||||
#
|
#
|
||||||
# Groove
|
# Groove
|
||||||
#
|
#
|
||||||
|
|
||||||
[image]
|
[rectangle]
|
||||||
# 4 pixels high
|
|
||||||
x = 0
|
x = 0
|
||||||
y = 0
|
y = 0
|
||||||
name = "buttons/scrollbars/scrollgroove-top.png{IPF}"
|
w = "(width)"
|
||||||
[/image]
|
h = "(height)"
|
||||||
|
fill_color = "4, 4, 4, 255"
|
||||||
[image]
|
[/rectangle]
|
||||||
x = 0
|
|
||||||
y = {GROOVE_TOP}
|
|
||||||
h = "(if(height - {GROOVE_TOP} - {GROOVE_BOTTOM} < 0
|
|
||||||
, 0, height - {GROOVE_TOP} - {GROOVE_BOTTOM}))"
|
|
||||||
resize_mode = "stretch"
|
|
||||||
name = "buttons/scrollbars/scrollgroove-mid.png{IPF}"
|
|
||||||
[/image]
|
|
||||||
|
|
||||||
[image]
|
|
||||||
# 5 pixels high
|
|
||||||
x = 0
|
|
||||||
y = "(height - {GROOVE_BOTTOM})"
|
|
||||||
name = "buttons/scrollbars/scrollgroove-bottom.png{IPF}"
|
|
||||||
[/image]
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Positioner
|
# Positioner
|
||||||
@ -48,8 +33,8 @@
|
|||||||
x = 0
|
x = 0
|
||||||
y = "(positioner_offset + {POSITIONER_TOP})"
|
y = "(positioner_offset + {POSITIONER_TOP})"
|
||||||
h = "(
|
h = "(
|
||||||
if(positioner_length - {POSITIONER_TOP} - {POSITIONER_BOTTOM} < 0
|
if(positioner_length - {POSITIONER_TOP} < 0
|
||||||
, 0, positioner_length - {POSITIONER_TOP} - {POSITIONER_BOTTOM}))"
|
, 0, positioner_length - {POSITIONER_TOP}))"
|
||||||
resize_mode = "stretch"
|
resize_mode = "stretch"
|
||||||
name = "buttons/scrollbars/scrollmid{IMAGE_SUFFIX}{IPF}"
|
name = "buttons/scrollbars/scrollmid{IMAGE_SUFFIX}{IPF}"
|
||||||
[/image]
|
[/image]
|
||||||
@ -57,14 +42,14 @@ if(positioner_length - {POSITIONER_TOP} - {POSITIONER_BOTTOM} < 0
|
|||||||
[image]
|
[image]
|
||||||
# 5 pixels high
|
# 5 pixels high
|
||||||
x = 0
|
x = 0
|
||||||
y = "(positioner_offset + positioner_length - {POSITIONER_BOTTOM})"
|
y = "(positioner_offset + positioner_length)"
|
||||||
name = "buttons/scrollbars/scrollbottom{IMAGE_SUFFIX}{IPF}"
|
name = "buttons/scrollbars/scrollbottom{IMAGE_SUFFIX}{IPF}"
|
||||||
[/image]
|
[/image]
|
||||||
|
|
||||||
[/draw]
|
[/draw]
|
||||||
#enddef
|
#enddef
|
||||||
|
|
||||||
#define _GUI_RESOLUTION RESOLUTION WIDTH HEIGHT POSITIONER_LENGHT GROOVE_TOP GROOVE_BOTTOM POSITIONER_TOP POSITIONER_BOTTOM IPF
|
#define _GUI_RESOLUTION RESOLUTION WIDTH HEIGHT POSITIONER_LENGHT POSITIONER_TOP IPF
|
||||||
[resolution]
|
[resolution]
|
||||||
|
|
||||||
{RESOLUTION}
|
{RESOLUTION}
|
||||||
@ -72,7 +57,7 @@ if(positioner_length - {POSITIONER_TOP} - {POSITIONER_BOTTOM} < 0
|
|||||||
min_width = {WIDTH}
|
min_width = {WIDTH}
|
||||||
min_height = {HEIGHT}
|
min_height = {HEIGHT}
|
||||||
|
|
||||||
default_width = {WIDTH}
|
default_width = 15
|
||||||
default_height = {HEIGHT}
|
default_height = {HEIGHT}
|
||||||
|
|
||||||
max_width = {WIDTH}
|
max_width = {WIDTH}
|
||||||
@ -84,19 +69,19 @@ if(positioner_length - {POSITIONER_TOP} - {POSITIONER_BOTTOM} < 0
|
|||||||
bottom_offset = 0
|
bottom_offset = 0
|
||||||
|
|
||||||
[state_enabled]
|
[state_enabled]
|
||||||
{_GUI_STATE ({GROOVE_TOP}) ({GROOVE_BOTTOM}) ({POSITIONER_TOP}) ({POSITIONER_BOTTOM}) ".png" ({IPF}) }
|
{_GUI_STATE ({POSITIONER_TOP}) ".png" ({IPF}) }
|
||||||
[/state_enabled]
|
[/state_enabled]
|
||||||
|
|
||||||
[state_disabled]
|
[state_disabled]
|
||||||
{_GUI_STATE ({GROOVE_TOP}) ({GROOVE_BOTTOM}) ({POSITIONER_TOP}) ({POSITIONER_BOTTOM}) ".png~GS()" ({IPF}) }
|
{_GUI_STATE ({POSITIONER_TOP}) ".png~GS()" ({IPF}) }
|
||||||
[/state_disabled]
|
[/state_disabled]
|
||||||
|
|
||||||
[state_pressed]
|
[state_pressed]
|
||||||
{_GUI_STATE ({GROOVE_TOP}) ({GROOVE_BOTTOM}) ({POSITIONER_TOP}) ({POSITIONER_BOTTOM}) "-pressed.png" ({IPF}) }
|
{_GUI_STATE ({POSITIONER_TOP}) "-pressed.png" ({IPF}) }
|
||||||
[/state_pressed]
|
[/state_pressed]
|
||||||
|
|
||||||
[state_focused]
|
[state_focused]
|
||||||
{_GUI_STATE ({GROOVE_TOP}) ({GROOVE_BOTTOM}) ({POSITIONER_TOP}) ({POSITIONER_BOTTOM}) "-active.png" ({IPF}) }
|
{_GUI_STATE ({POSITIONER_TOP}) "-active.png" ({IPF}) }
|
||||||
[/state_focused]
|
[/state_focused]
|
||||||
[/resolution]
|
[/resolution]
|
||||||
#enddef
|
#enddef
|
||||||
@ -108,27 +93,10 @@ if(positioner_length - {POSITIONER_TOP} - {POSITIONER_BOTTOM} < 0
|
|||||||
# Note a scrollbar is normally sized by the item that "masters" it
|
# Note a scrollbar is normally sized by the item that "masters" it
|
||||||
# that's why the default height is rather low.
|
# that's why the default height is rather low.
|
||||||
|
|
||||||
{_GUI_RESOLUTION () 25 20 11 4 5 5 5 ()}
|
{_GUI_RESOLUTION () 25 20 11 2 ()}
|
||||||
|
|
||||||
[/vertical_scrollbar_definition]
|
[/vertical_scrollbar_definition]
|
||||||
|
|
||||||
#
|
|
||||||
# This is meant to be used for a minimal scrollbar definition, removing the
|
|
||||||
# up/down toggle buttons and reducing the width of the bar by 8 px.
|
|
||||||
# However, since the toggle buttons on a scrollbar panel aren't definition-
|
|
||||||
# dependent, this is commented out for now.
|
|
||||||
#
|
|
||||||
#[vertical_scrollbar_definition]
|
|
||||||
# id = "minimal"
|
|
||||||
# description = "a minimal vertical scrollbar"
|
|
||||||
#
|
|
||||||
# # Note a scrollbar is normally sized by the item that "masters" it
|
|
||||||
# # that's why the default height is rather low.
|
|
||||||
|
|
||||||
# {_GUI_RESOLUTION () 17 20 11 4 5 4 4 ()}
|
|
||||||
#
|
|
||||||
#[/vertical_scrollbar_definition]
|
|
||||||
|
|
||||||
[vertical_scrollbar_definition]
|
[vertical_scrollbar_definition]
|
||||||
id = "transparent"
|
id = "transparent"
|
||||||
description = "a transparent vertical scrollbar"
|
description = "a transparent vertical scrollbar"
|
||||||
@ -136,7 +104,7 @@ if(positioner_length - {POSITIONER_TOP} - {POSITIONER_BOTTOM} < 0
|
|||||||
# Note a scrollbar is normally sized by the item that "masters" it
|
# Note a scrollbar is normally sized by the item that "masters" it
|
||||||
# that's why the default height is rather low.
|
# that's why the default height is rather low.
|
||||||
|
|
||||||
{_GUI_RESOLUTION () 25 20 11 4 5 5 5 "~O(65%)"}
|
{_GUI_RESOLUTION () 25 20 11 5 "~O(65%)"}
|
||||||
|
|
||||||
[/vertical_scrollbar_definition]
|
[/vertical_scrollbar_definition]
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 101 B After Width: | Height: | Size: 154 B |
Before Width: | Height: | Size: 167 B |
Before Width: | Height: | Size: 167 B |
Before Width: | Height: | Size: 172 B |
Before Width: | Height: | Size: 102 B After Width: | Height: | Size: 154 B |
Before Width: | Height: | Size: 103 B After Width: | Height: | Size: 155 B |
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 232 B |
Before Width: | Height: | Size: 242 B |
Before Width: | Height: | Size: 243 B |
Before Width: | Height: | Size: 247 B |
Before Width: | Height: | Size: 213 B After Width: | Height: | Size: 231 B |
Before Width: | Height: | Size: 199 B After Width: | Height: | Size: 235 B |
Before Width: | Height: | Size: 118 B After Width: | Height: | Size: 168 B |
Before Width: | Height: | Size: 179 B |
Before Width: | Height: | Size: 179 B |
Before Width: | Height: | Size: 169 B |
Before Width: | Height: | Size: 121 B After Width: | Height: | Size: 169 B |
Before Width: | Height: | Size: 104 B After Width: | Height: | Size: 158 B |