wesnoth/data/gui/macros/_initial.cfg
2016-03-20 01:11:10 +11:00

266 lines
5.4 KiB
INI

#textdomain wesnoth-lib
#
# Contains the macros for the default widgets.
# - Global GUI macros get the GUI prefix.
# - Local (pre file) GUI macros get the _GUI prefix and should be undefined at
# the end of the file.
#
#
# Later there will also be definitions for larger screens, mainly for using the
# extra width better.
###############################################################################
### ###
### Generic macros usable for all resolutions. ###
### ###
###############################################################################
# Centers the text horizontally.
#
# If the text is too wide it returns the left side.
# Rounding happens to the left side.
#define GUI__TEXT_HORIZONTALLY_CENTRED
"(if(text_width < width, (width - text_width ) / 2, 0))"
#enddef
# Centers the text vertically.
#
# 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))"
#enddef
#define GUI__CENTERED_TEXT FONT_SIZE FONT_STYLE FONT_COLOR
[text]
x = {GUI__TEXT_HORIZONTALLY_CENTRED}
y = {GUI__TEXT_VERTICALLY_CENTRED}
w = "(text_width)"
h = "(text_height)"
font_size = {FONT_SIZE}
font_style = {FONT_STYLE}
color = {FONT_COLOR}
text = "(text)"
text_markup = "(text_markup)"
[/text]
#enddef
#define GUI__LEFT_TEXT FONT_SIZE FONT_STYLE FONT_COLOR
[text]
x = 5
y = {GUI__TEXT_VERTICALLY_CENTRED}
w = "(text_width)"
h = "(text_height)"
font_size = {FONT_SIZE}
font_style = {FONT_STYLE}
color = {FONT_COLOR}
text = "(text)"
text_markup = "(text_markup)"
[/text]
#enddef
# This white color is used for most texts.
#define GUI__FONT_COLOR_ENABLED__DEFAULT
"215, 215, 215, 255"
#enddef
# This gray color is used for most text when the widget is disabled.
#define GUI__FONT_COLOR_DISABLED__DEFAULT
"128, 128, 128, 255"
#enddef
# This gold color is used for the
# - title labels
# - button captions
# - checkbox captions
# - menu captions
#define GUI__FONT_COLOR_ENABLED__TITLE
"188, 176, 136, 255"
#enddef
# This now uses the default disabled color but should be tiny bit lighter.
#define GUI__FONT_COLOR_DISABLED__TITLE
{GUI__FONT_COLOR_DISABLED__DEFAULT}
#enddef
# This color is used as background in the listbox.
#define GUI__BACKGROUND_COLOR_ENABLED
"0, 0, 0, 89"
#enddef
#define GUI__BACKGROUND_COLOR_DISABLED
"64, 64, 64, 64"
#enddef
#define GUI__BORDER_COLOR
"162, 127, 68, 255"
#enddef
# Draws the background for a selected cell in a listbox. For now there's one
# version for both tiny and normal gui.
#define GUI__LISTBOX_SELECTED_CELL
[rectangle]
x = 0
y = 0
w = "(width)"
h = "(height)"
border_thickness = 1
border_color = {GUI__BORDER_COLOR}
[/rectangle]
[image]
x = 1
y = 1
w = "(width - 2)"
h = "(height - 2)"
name = "dialogs/selection-background.png"
[/image]
#enddef
# Forces a wiget to be of a certain size.
# Depending of the flags of the parent widget the item will grow
#
# WIDTH Minimum width for the widget.
# HEIGHT Minimum height for the widget.
# WIDGET The widget to add into the item.
#
# eg instead of
# [label]
# # Note Foo has trailing spaces to force extra width.
# label = "
# Foo
# "
# [label]
# you can do:
#
# {GUI_FORCE_WIDGET_MINIMUM_SIZE 150 75 (
# [label]
# label = "Foo"
# [label]
# )}
#
#define GUI_FORCE_WIDGET_MINIMUM_SIZE WIDTH HEIGHT WIDGET
[stacked_widget]
definition = "default"
[stack]
[layer]
[row]
[column]
[spacer]
definition = "default"
width = "{WIDTH}"
height = "{HEIGHT}"
[/spacer]
[/column]
[/row]
[/layer]
[layer]
[row]
grow_factor = 1
[column]
grow_factor = 1
horizontal_grow = "true"
vertical_grow = "true"
{WIDGET}
[/column]
[/row]
[/layer]
[/stack]
[/stacked_widget]
#enddef
#define GUI_WINDOW_FULLSCREEN
automatic_placement = "false"
x = 0
y = 0
width = "(screen_width)"
height = "(screen_height)"
#enddef
#define GUI_HORIZONTAL_SPACER_LINE
[row]
grow_factor = 0
[column]
grow_factor = 1
border = "all"
border_size = 10
horizontal_grow = true
[drawing]
definition = "default"
width = (width)
height = 1
[draw]
[line]
x1 = 0
y1 = 0
x2 = (width - 1)
y2 = 0
color = {GUI__FONT_COLOR_DISABLED__DEFAULT}
thickness = 1
[/line]
[/draw]
[/drawing]
[/column]
[/row]
#enddef
###############################################################################
### ###
### Macros for the normal gui. ###
### ###
###############################################################################
#define GUI_NORMAL__RESOLUTION
window_width = 0
window_height = 0
#enddef
#define GUI_NORMAL__FONT_SIZE__TINY
10
#enddef
#define GUI_NORMAL__FONT_SIZE__SMALL
12
#enddef
#define GUI_NORMAL__FONT_SIZE__DEFAULT
14
#enddef
#define GUI_NORMAL__FONT_SIZE__LARGE
18
#enddef
#define GUI_NORMAL__FONT_SIZE__TITLE
20
#enddef