#textdomain wesnoth-lib ### ### Definition of a horizontal scrollbar. ### #define _GUI_STATE POSITIONER_LEFT BG_COLOR IMAGE_SUFFIX IPF [draw] # # Groove # [rectangle] x = 0 y = 0 w = "(width)" h = "(height)" fill_color = {BG_COLOR} [/rectangle] # # Positioner # [image] # 5 pixels high x = "(positioner_offset)" y = 0 name = "buttons/scrollbars/scrollleft{IMAGE_SUFFIX}{IPF}" [/image] [image] x = "(positioner_offset + {POSITIONER_LEFT})" y = 0 w = "( if(positioner_length - {POSITIONER_LEFT} < 0 , 0, positioner_length - {POSITIONER_LEFT}))" resize_mode = "stretch" name = "buttons/scrollbars/scrollhorizontal{IMAGE_SUFFIX}{IPF}" [/image] [image] # 5 pixels high x = "(positioner_offset + positioner_length)" y = 0 name = "buttons/scrollbars/scrollright{IMAGE_SUFFIX}{IPF}" [/image] [/draw] #enddef #define _GUI_RESOLUTION RESOLUTION WIDTH HEIGHT POSITIONER_LENGHT POSITIONER_LEFT IPF [resolution] {RESOLUTION} min_width = {WIDTH} min_height = {HEIGHT} default_width = {WIDTH} default_height = 15 max_width = 0 max_height = {HEIGHT} minimum_positioner_length = {POSITIONER_LENGHT} left_offset = 0 right_offset = 0 [state_enabled] {_GUI_STATE ({POSITIONER_LEFT}) ({GUI__BACKGROUND_COLOR_ENABLED}) ".png" ({IPF}) } [/state_enabled] [state_disabled] {_GUI_STATE ({POSITIONER_LEFT}) ({GUI__BACKGROUND_COLOR_DISABLED}) ".png~GS()" ({IPF}) } [/state_disabled] [state_pressed] {_GUI_STATE ({POSITIONER_LEFT}) ({GUI__BACKGROUND_COLOR_ENABLED}) "-pressed.png" ({IPF}) } [/state_pressed] [state_focused] {_GUI_STATE ({POSITIONER_LEFT}) ({GUI__BACKGROUND_COLOR_ENABLED}) "-active.png" ({IPF}) } [/state_focused] [/resolution] #enddef [horizontal_scrollbar_definition] id = "default" description = "a horizontal scrollbar" # Note a scrollbar is normally sized by the item that "masters" it # that's why the default height is rather low. {_GUI_RESOLUTION () 20 25 11 2 ()} [/horizontal_scrollbar_definition] [horizontal_scrollbar_definition] id = "transparent" description = "a transparent horizontal scrollbar" # Note a scrollbar is normally sized by the item that "masters" it # that's why the default height is rather low. {_GUI_RESOLUTION () 20 25 11 2 "~O(65%)"} [/horizontal_scrollbar_definition] #undef _GUI_STATE #undef _GUI_RESOLUTION