From 596eeca1de55953e793996f01df5f1f3c9ed99cf Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Sat, 28 Feb 2009 18:09:29 +0000 Subject: [PATCH] Add a new transparent scrolllabel for wml_message. --- .../default/macros/horizontal_scrollbar.cfg | 43 ++++++ .../gui/default/macros/vertical_scrollbar.cfg | 52 ++++++++ .../widget/scroll_label_wml_message.cfg | 123 ++++++++++++++++++ data/gui/default/window/wml_message.cfg | 2 +- 4 files changed, 219 insertions(+), 1 deletion(-) create mode 100644 data/gui/default/widget/scroll_label_wml_message.cfg diff --git a/data/gui/default/macros/horizontal_scrollbar.cfg b/data/gui/default/macros/horizontal_scrollbar.cfg index 574493731ce..abe1491cfdd 100644 --- a/data/gui/default/macros/horizontal_scrollbar.cfg +++ b/data/gui/default/macros/horizontal_scrollbar.cfg @@ -43,3 +43,46 @@ horizontal_grow = "true" [/grid] #enddef +#define GUI__HORIZONTAL_SCROLLBAR_GRID_TRANSPARENT +horizontal_grow = "true" +[grid] + id = "_horizontal_scrollbar_grid" + + [row] + + [column] + + # note we want a special button definition for this later. + [button] + id = "_half_page_up" + definition = "left_arrow_transparent" + [/button] + + [/column] + + [column] + grow_factor = 1 + horizontal_grow = "true" + + [horizontal_scrollbar] + id = "_horizontal_scrollbar" + definition = "transparent" + [/horizontal_scrollbar] + + [/column] + + [column] + + # note we want a special button definition for this later. + [button] + id = "_half_page_down" + definition = "right_arrow_transparent" + [/button] + + [/column] + + [/row] + +[/grid] +#enddef + diff --git a/data/gui/default/macros/vertical_scrollbar.cfg b/data/gui/default/macros/vertical_scrollbar.cfg index e0f030575c8..d8d932f5998 100644 --- a/data/gui/default/macros/vertical_scrollbar.cfg +++ b/data/gui/default/macros/vertical_scrollbar.cfg @@ -50,3 +50,55 @@ vertical_grow = "true" [/grid] #enddef + +#define GUI__VERTICAL_SCROLLBAR_GRID_TRANSPARENT +vertical_grow = "true" +[grid] + id = "_vertical_scrollbar_grid" + + [row] + + [column] + + # note we want a special button definition for this later. + [button] + id = "_half_page_up" + definition = "up_arrow_transparent" + [/button] + + [/column] + + [/row] + + [row] + + grow_factor = 1 + [column] + vertical_grow = "true" + + [vertical_scrollbar] + id = "_vertical_scrollbar" + definition = "transparent" + [/vertical_scrollbar] + + [/column] + + [/row] + + [row] + + [column] + + # note we want a special button definition for this later. + [button] + id = "_half_page_down" + definition = "down_arrow_transparent" + [/button] + + [/column] + + [/row] + +[/grid] +#enddef + diff --git a/data/gui/default/widget/scroll_label_wml_message.cfg b/data/gui/default/widget/scroll_label_wml_message.cfg new file mode 100644 index 00000000000..21ff6023a99 --- /dev/null +++ b/data/gui/default/widget/scroll_label_wml_message.cfg @@ -0,0 +1,123 @@ +#textdomain wesnoth-lib +### +### Definition of a scroll label for the wml_message. +### + +#define _GUI_RESOLUTION RESOLUTION FONT_SIZE FONT_STYLE FONT_COLOUR_ENABLED FONT_COLOUR_DISABLED + [resolution] + + {RESOLUTION} + + min_width = 0 + min_height = 0 + + default_width = 0 + default_height = 0 + + max_width = 0 + max_height = 0 + + text_font_size = {FONT_SIZE} + text_font_style = {FONT_STYLE} + + [state_enabled] + + [draw] + [/draw] + + [/state_enabled] + + [state_disabled] + + [draw] + [/draw] + + [/state_disabled] + + [grid] + + [row] + grow_factor = 1 + + [column] + grow_factor = 1 + horizontal_grow = "true" # needed ? + vertical_grow = "true" # needed ? + + [grid] + id = "_content_grid" + + [row] + + [column] + horizontal_grow = "true" + vertical_grow = "true" + + [label] + id = "_label" + definition = "default" + [/label] + + [/column] + + [/row] + + [/grid] + + [/column] + + [column] + + {GUI__VERTICAL_SCROLLBAR_GRID_TRANSPARENT} + + [/column] + + [/row] + + [row] + + [column] + + {GUI__HORIZONTAL_SCROLLBAR_GRID_TRANSPARENT} + + [/column] + + [column] + + [spacer] + [/spacer] + + [/column] + + [/row] + + [/grid] + + [/resolution] +#enddef + +[scroll_label_definition] + id = "wml_message" + description = "The scroll label for the wml_message." + + {_GUI_RESOLUTION + ({GUI_TINY__RESOLUTION}) + ({GUI_TINY__FONT_SIZE__DEFAULT}) + () + ({GUI__FONT_COLOUR_ENABLED__DEFAULT}) + ({GUI__FONT_COLOUR_DISABLED__DEFAULT}) + } + + + {_GUI_RESOLUTION + ({GUI_NORMAL__RESOLUTION}) + ({GUI_NORMAL__FONT_SIZE__DEFAULT}) + () + ({GUI__FONT_COLOUR_ENABLED__DEFAULT}) + ({GUI__FONT_COLOUR_DISABLED__DEFAULT}) + } + +[/scroll_label_definition] + +#undef _GUI_RESOLUTION + diff --git a/data/gui/default/window/wml_message.cfg b/data/gui/default/window/wml_message.cfg index fbe79d825d3..0dfa9aba0f9 100644 --- a/data/gui/default/window/wml_message.cfg +++ b/data/gui/default/window/wml_message.cfg @@ -371,7 +371,7 @@ [scroll_label] # NOTE maybe change the code to use message instead of label as id id = "label" - definition = "default" + definition = "wml_message" [/scroll_label] [/column]