mail[Wesnoth-commits] r28885 - /trunk/data/gui/default/widget/toggle_button_listbox_text.cfg


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by koraq on August 23, 2008 - 18:54:
Author: mordante
Date: Sat Aug 23 18:54:00 2008
New Revision: 28885

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28885&view=rev
Log:
Refactored the listbox text items.

More macros and added the tiny-gui definitions.

Modified:
    trunk/data/gui/default/widget/toggle_button_listbox_text.cfg

Modified: trunk/data/gui/default/widget/toggle_button_listbox_text.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/gui/default/widget/toggle_button_listbox_text.cfg?rev=28885&r1=28884&r2=28885&view=diff
==============================================================================
--- trunk/data/gui/default/widget/toggle_button_listbox_text.cfg (original)
+++ trunk/data/gui/default/widget/toggle_button_listbox_text.cfg Sat Aug 23 
18:54:00 2008
@@ -5,7 +5,7 @@
 ###
 
 # FIXME we should use a background image instead of a filled rect.
-#define RECT BORDER_COLOUR FILL_COLOUR
+#define _GUI_DRAW_RECT BORDER_COLOUR FILL_COLOUR
        [rectangle]
                x = 0
                y = 0
@@ -17,44 +17,42 @@
        [/rectangle]
 #enddef
 
-#define TEXT
+#define _GUI_DRAW_TEXT FONT_SIZE FONT_COLOUR
        [text]
                x = 3
                y = {TEXT_V_CENTRE}
                w = "(width - 6)"
                h =  "(text_height)"
-               font_size = {FONT_SIZE_NORMAL__NORMAL}
-               colour = {FONT_COLOUR_ENABLED}
+               font_size = {FONT_SIZE}
+               colour = {FONT_COLOUR}
                text = "(text)"
        [/text]
 #enddef
 
-[toggle_button_definition]
 
-       id = "listbox_text"
-       description = "This toggle button is meant to be used in a listbox 
and as list box with only text."
-
+#define _GUI_RESOLUTION RESOLUTION MIN_WIDTH DEFAULT_WIDTH HEIGHT 
EXTRA_WIDTH FONT_SIZE 
        [resolution]
 
-               min_width = 30
-               min_height = 25
+               min_width = {MIN_WIDTH}
+               min_height = {HEIGHT}
 
-               default_width = 30
-               default_height = 25
+               default_width = {DEFAULT_WIDTH}
+               default_height = {HEIGHT}
 
                max_width = 0
-               max_height = 25
+               max_height = {HEIGHT}
 
-               text_extra_width = 6
-               text_font_size = {FONT_SIZE_NORMAL__NORMAL}
+               text_extra_width = {EXTRA_WIDTH}
+               text_font_size = {FONT_SIZE}
 
                [state_enabled]
                        full_redraw = "true"
 
                        [draw]
 
-                               {RECT "" "0, 0, 0, 255"}
-                               {TEXT}
+                               {_GUI_DRAW_RECT "" "0, 0, 0, 255"}
+
+                               {_GUI_DRAW_TEXT ({FONT_SIZE}) 
({GUI__FONT_COLOUR_ENABLED__DEFAULT}) }
 
                        [/draw]
 
@@ -65,8 +63,9 @@
 
                        [draw]
 
-                               {RECT "" "128, 128, 128, 255"}
-                               {TEXT}
+                               {_GUI_DRAW_RECT "" "64, 64, 64, 255"}
+
+                               {_GUI_DRAW_TEXT ({FONT_SIZE}) 
({GUI__FONT_COLOUR_DISABLED__DEFAULT}) }
 
                        [/draw]
 
@@ -77,8 +76,9 @@
 
                        [draw]
 
-                               {RECT "" "0, 0, 0, 255"}
-                               {TEXT}
+                               {_GUI_DRAW_RECT "" "0, 0, 0, 255"}
+
+                               {_GUI_DRAW_TEXT ({FONT_SIZE}) 
({GUI__FONT_COLOUR_ENABLED__DEFAULT}) }
 
                        [/draw]
 
@@ -93,8 +93,9 @@
 
                        [draw]
 
-                               {RECT "170, 136, 67, 255" "9, 33, 54, 255"}
-                               {TEXT}
+                               {_GUI_DRAW_RECT "170, 136, 67, 255" "9, 33, 
54, 255"}
+
+                               {_GUI_DRAW_TEXT ({FONT_SIZE}) 
({GUI__FONT_COLOUR_ENABLED__DEFAULT}) }
 
                        [/draw]
 
@@ -105,8 +106,9 @@
 
                        [draw]
 
-                               {RECT "170, 136, 67, 255" "128, 128, 128, 
255"}
-                               {TEXT}
+                               {_GUI_DRAW_RECT "170, 136, 67, 255" "128, 
128, 128, 255"}
+
+                               {_GUI_DRAW_TEXT ({FONT_SIZE}) 
({GUI__FONT_COLOUR_ENABLED__DEFAULT}) }
 
                        [/draw]
 
@@ -117,17 +119,28 @@
 
                        [draw]
 
-                               {RECT "170, 136, 67, 255" "9, 33, 54, 255"}
-                               {TEXT}
+                               {_GUI_DRAW_RECT "170, 136, 67, 255" "9, 33, 
54, 255"}
+
+                               {_GUI_DRAW_TEXT ({FONT_SIZE}) 
({GUI__FONT_COLOUR_ENABLED__DEFAULT}) }
 
                        [/draw]
 
                [/state_focussed_selected]
 
        [/resolution]
+#enddef
+
+[toggle_button_definition]
+
+       id = "listbox_text"
+       description = "This toggle button is meant to be used in a listbox 
and as list box with only text."
+
+       # Tiny gui sizes haven't been tested yet so might need some tuning.
+       {_GUI_RESOLUTION ({GUI_TINY__RESOLUTION}) 15 30 15 4 
({GUI_TINY__FONT_SIZE__DEFAULT})   }
+       {_GUI_RESOLUTION ()                       30 30 25 6 
({GUI_NORMAL__FONT_SIZE__DEFAULT}) }
 
 [/toggle_button_definition]
 
-
-#undef RECT
-#undef TEXT
+#undef _GUI_DRAW_RECT
+#undef _GUI_DRAW_TEXT
+#undef _GUI_RESOLUTION




Related Messages


Powered by MHonArc, Updated Sat Aug 23 19:01:41 2008