Skip to content

Commit

Permalink
New design for vertical scrollbars (horizontal pending)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Apr 3, 2016
1 parent 00b571a commit 0708069
Show file tree
Hide file tree
Showing 23 changed files with 217 additions and 75 deletions.
12 changes: 6 additions & 6 deletions data/gui/macros/_initial.cfg
Expand Up @@ -29,7 +29,7 @@
# If the text is too high it returns the top side.
# Rounding happens to the bottom side.
#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

#define GUI__CENTERED_TEXT FONT_SIZE FONT_STYLE FONT_COLOR
Expand Down Expand Up @@ -291,21 +291,21 @@
#enddef

#define GUI_NORMAL__FONT_SIZE__TINY
10
13
#enddef

#define GUI_NORMAL__FONT_SIZE__SMALL
12
15
#enddef

#define GUI_NORMAL__FONT_SIZE__DEFAULT
14
17
#enddef

#define GUI_NORMAL__FONT_SIZE__LARGE
18
20
#enddef

#define GUI_NORMAL__FONT_SIZE__TITLE
20
24
#enddef
7 changes: 4 additions & 3 deletions data/gui/macros/vertical_scrollbar.cfg
Expand Up @@ -13,7 +13,7 @@ vertical_grow = "true"
# note we want a special button definition for this later.
[repeating_button]
id = "_half_page_up"
definition = "up_arrow"
definition = "scrollbar_up_arrow"
[/repeating_button]

[/column]
Expand All @@ -22,7 +22,8 @@ vertical_grow = "true"

[row]

grow_factor = 1
grow_factor = 1

[column]
vertical_grow = "true"

Expand All @@ -42,7 +43,7 @@ vertical_grow = "true"
# note we want a special button definition for this later.
[repeating_button]
id = "_half_page_down"
definition = "down_arrow"
definition = "scrollbar_down_arrow"
[/repeating_button]

[/column]
Expand Down
17 changes: 0 additions & 17 deletions data/gui/widget/repeating_button_default.cfg
Expand Up @@ -157,22 +157,6 @@

# 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
"left_arrow_transparent"
"Left arrow button for a transparent scrollbar."
Expand All @@ -191,4 +175,3 @@

#undef _GUI_DEFINITION
#undef _GUI_RESOLUTION

190 changes: 190 additions & 0 deletions data/gui/widget/repeating_button_scrollbar.cfg
@@ -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

0 comments on commit 0708069

Please sign in to comment.