mail[Wesnoth-commits] r28973 - /trunk/data/gui/default/widget/slider_default.cfg


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

Header


Content

Posted by koraq on August 25, 2008 - 17:36:
Author: mordante
Date: Mon Aug 25 17:36:05 2008
New Revision: 28973

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28973&view=rev
Log:
Updated to the new style.

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

Modified: trunk/data/gui/default/widget/slider_default.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/gui/default/widget/slider_default.cfg?rev=28973&r1=28972&r2=28973&view=diff
==============================================================================
--- trunk/data/gui/default/widget/slider_default.cfg (original)
+++ trunk/data/gui/default/widget/slider_default.cfg Mon Aug 25 17:36:05 2008
@@ -2,8 +2,8 @@
 ### Definition of a slider.
 ###
 
-#define STATE IMAGE_SUFFIX GROOVE_COLOUR TEXT_COLOUR
-full_redraw = "true"
+#define _GUI_STATE IMAGE_SUFFIX GROOVE_COLOUR TEXT_COLOUR RIGHT_OFFSET 
TEXT_OFFSET TEXT_WIDTH FONT_SIZE
+       full_redraw = "true"
 
        [draw]
 
@@ -14,7 +14,7 @@
                [line]
                        x1 = 0
                        y1 = "(height / 2)"
-                       x2 = "(width - 136)"
+                       x2 = "(width - ({RIGHT_OFFSET} + 1))"
                        y2 = "(height / 2)"
 
                        colour = {GROOVE_COLOUR}
@@ -26,12 +26,12 @@
                #
 
                [text]
-                       x = "(width - 130)"
-                       y = {TEXT_V_CENTRE}
-                       w = 30
+                       x = "(width - {TEXT_OFFSET})"
+                       y = {GUI__TEXT_VERTICALLY_CENTRED}
+                       w = "{TEXT_WIDTH}"
                        h = "(height)"
 
-                       font_size = 16
+                       font_size = {FONT_SIZE}
                        colour = {TEXT_COLOUR}
                        text = "(text)"
                [/text]
@@ -42,53 +42,97 @@
 
                [image]
                        x = "(positioner_offset)"
-                       y = "(height - image_height) / 2"
-                       name = "buttons/slider" + {IMAGE_SUFFIX} + ".png"
+                       y = "(if (image_height < height, (height - 
image_height) / 2, 0))"
+                       name = "buttons/slider{IMAGE_SUFFIX}.png"
                [/image]
 
        [/draw]
+#enddef
+
+#define _GUI_RESOLUTION RESOLUTION MIN_WIDTH DEFAULT_WIDTH HEIGHT 
POSITIONER_LENGTH RIGHT_OFFSET TEXT_OFFSET TEXT_WIDTH FONT_SIZE 
+
+       [resolution]
+
+               {RESOLUTION}
+
+               min_width = {MIN_WIDTH}
+               min_height = {HEIGHT}
+
+               default_width = {DEFAULT_WIDTH}
+               default_height = {HEIGHT}
+
+               max_width = 0
+               max_height = {HEIGHT}
+
+               minimum_positioner_length = {POSITIONER_LENGTH}
+               maximum_positioner_length = {POSITIONER_LENGTH}
+
+               left_offset = 0
+               right_offset = {RIGHT_OFFSET}
+
+               text_font_size = {FONT_SIZE}
+
+               [state_enabled]
+                       {_GUI_STATE 
+                               ()
+                               ({GUI__FONT_COLOUR_ENABLED__DEFAULT})
+                               ({GUI__FONT_COLOUR_ENABLED__DEFAULT})
+                               ({RIGHT_OFFSET})
+                               ({TEXT_OFFSET})
+                               ({TEXT_WIDTH})
+                               ({FONT_SIZE})
+                       }
+               [/state_enabled]
+
+               [state_disabled]
+                       {_GUI_STATE 
+                               "-disabled" 
+                               ({GUI__FONT_COLOUR_DISABLED__DEFAULT})
+                               ({GUI__FONT_COLOUR_DISABLED__DEFAULT})
+                               ({RIGHT_OFFSET})
+                               ({TEXT_OFFSET})
+                               ({TEXT_WIDTH})
+                               ({FONT_SIZE})
+                       }
+               [/state_disabled]
+
+               [state_pressed]
+                       {_GUI_STATE 
+                               "-selected" 
+                               ({GUI__FONT_COLOUR_ENABLED__DEFAULT})
+                               ({GUI__FONT_COLOUR_ENABLED__DEFAULT})
+                               ({RIGHT_OFFSET})
+                               ({TEXT_OFFSET})
+                               ({TEXT_WIDTH})
+                               ({FONT_SIZE})
+                       }
+               [/state_pressed]
+               
+               [state_focussed]
+                       {_GUI_STATE 
+                               "-active" 
+                               ({GUI__FONT_COLOUR_ENABLED__DEFAULT})
+                               ({GUI__FONT_COLOUR_ENABLED__DEFAULT})
+                               ({RIGHT_OFFSET})
+                               ({TEXT_OFFSET})
+                               ({TEXT_WIDTH})
+                               ({FONT_SIZE})
+                       }
+               [/state_focussed]
+
+       [/resolution]
 #enddef
 
 [slider_definition]
        id = "default"
        description = "A slider with it's value on the right hand side."
 
-       [resolution]
-               min_width = 150
-               min_height = 22
-
-               default_width = 250
-               default_height = 22
-
-               max_width = 0
-               max_height = 22
-
-               text_font_size = 16
-
-               minimum_positioner_length = 16
-               maximum_positioner_length = 16
-
-               left_offset = 0
-               right_offset = 135
-
-               [state_enabled]
-                       {STATE "" "255, 255, 255, 255" "255, 255, 255, 255"}
-               [/state_enabled]
-
-               [state_disabled]
-                       {STATE "-disabled" "255, 255, 255, 255" "255, 255, 
255, 255"}
-               [/state_disabled]
-
-               [state_pressed]
-                       {STATE "-selected" "255, 255, 255, 255" "255, 255, 
255, 255"}
-               [/state_pressed]
-               
-               [state_focussed]
-                       {STATE "-active" "255, 255, 255, 255" "255, 255, 255, 
255"}
-               [/state_focussed]
-
-       [/resolution]
+       # Tiny gui sizes haven't been tested yet so might need some tuning.
+       {_GUI_RESOLUTION ({GUI_TINY__RESOLUTION})  75 125 11  8  68  65 15 
({GUI_TINY__FONT_SIZE__DEFAULT})   }
+       {_GUI_RESOLUTION ()                       150 250 22 16 135 130 30 
({GUI_NORMAL__FONT_SIZE__DEFAULT}) }
 
 [/slider_definition]
 
-#undef STATE
+#undef _GUI_STATE
+#undef _GUI_RESOLUTION 
+




Related Messages


Powered by MHonArc, Updated Mon Aug 25 17:41:22 2008