celes theme: listbox header definition

This commit is contained in:
Subhraman Sarkar 2025-01-12 11:56:07 +05:30
parent 35071f38d5
commit 50fe386aa7
2 changed files with 237 additions and 0 deletions

View File

@ -0,0 +1,237 @@
#textdomain wesnoth-lib
###
### Definition of the default toggle button.
### Since for this class 'default' is a bit hard we now use the checkbox as default.
###
#define _GUI_TEXT HORIZONTAL_POSITION FONT_SIZE FONT_COLOR
[text]
x = {HORIZONTAL_POSITION}
y = {GUI__TEXT_VERTICALLY_CENTRED}
w = "(width)"
h = "(text_height)"
font_size = {FONT_SIZE}
font_style = "bold"
color = {FONT_COLOR}
text = "(text)"
[/text]
#enddef
#define _GUI_RESOLUTION RESOLUTION WIDTH HEIGHT FONT_SIZE
#arg HORIZONTAL_POSITION
5 #endarg
[resolution]
{RESOLUTION}
min_width = {WIDTH}
min_height = {HEIGHT}
default_width = {WIDTH}
default_height = {HEIGHT}
max_width = 0
max_height = {HEIGHT}
text_extra_width = 0
text_font_size = {FONT_SIZE}
[state]
[enabled]
[draw]
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__WHITE}) }
[/draw]
[/enabled]
[disabled]
[draw]
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_DISABLED__WHITE}) }
[/draw]
[/disabled]
[focused]
[draw]
[rectangle]
x = 0
y = 0
w = "(width)"
h = "(height)"
fill_color = "255, 255, 255, 76"
[/rectangle]
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__WHITE}) }
[/draw]
[/focused]
[/state]
###
### Down
###
[state]
[enabled]
[draw]
[rectangle]
x = 0
y = 0
w = "(width)"
h = "(height)"
fill_color = "255, 255, 255, 25"
[/rectangle]
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__WHITE}) }
[image]
x = "(width - 18)"
y = "(height / 3)"
name = "buttons/modern/triangle.png"
[/image]
[/draw]
[/enabled]
[disabled]
[draw]
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_DISABLED__WHITE}) }
[image]
x = "(width - 18)"
y = "(height / 3)"
name = "buttons/modern/triangle.png~GS()"
[/image]
[/draw]
[/disabled]
[focused]
[draw]
[rectangle]
x = 0
y = 0
w = "(width)"
h = "(height)"
fill_color = "255, 255, 255, 76"
[/rectangle]
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__WHITE}) }
[image]
x = "(width - 18)"
y = "(height / 3)"
name = "buttons/modern/triangle.png"
[/image]
[/draw]
[/focused]
[/state]
###
### Up
###
[state]
[enabled]
[draw]
[rectangle]
x = 0
y = 0
w = "(width)"
h = "(height)"
fill_color = "255, 255, 255, 25"
[/rectangle]
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__WHITE}) }
[image]
x = "(width - 18)"
y = "(height / 3)"
name = "buttons/modern/triangle.png~ROTATE(180)"
[/image]
[/draw]
[/enabled]
[disabled]
[draw]
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_DISABLED__WHITE}) }
[image]
x = "(width - 18)"
y = "(height / 3)"
name = "buttons/modern/triangle.png~ROTATE(180)~GS()"
[/image]
[/draw]
[/disabled]
[focused]
[draw]
[rectangle]
x = 0
y = 0
w = "(width)"
h = "(height)"
fill_color = "255, 255, 255, 76"
[/rectangle]
{_GUI_TEXT ({HORIZONTAL_POSITION}) ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__WHITE}) }
[image]
x = "(width - 18)"
y = "(height / 3)"
name = "buttons/modern/triangle.png~ROTATE(180)"
[/image]
[/draw]
[/focused]
[/state]
[/resolution]
#enddef
[toggle_button_definition]
id = "listbox_header"
description = "Checkbox."
{_GUI_RESOLUTION () 30 30 ({GUI_FONT_SIZE_SMALL}) }
[/toggle_button_definition]
[toggle_button_definition]
id = "listbox_header_centered"
description = "Checkbox, centered."
{_GUI_RESOLUTION () 30 30 ({GUI_FONT_SIZE_SMALL}) HORIZONTAL_POSITION={GUI__TEXT_HORIZONTALLY_CENTRED}}
[/toggle_button_definition]
#undef _GUI_TEXT
#undef _GUI_RESOLUTION

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB