#textdomain wesnoth-lib ### ### buttons with success indication ### #define _GUI_STATE BACKGROUND_IMAGE BORDER_COLOR BORDER_COLOR_DARK HIGHLIGHT_LINE_COLOR IPF {GUI__BUTTON_NORMAL_FRAME buttons/modern/normal/{BACKGROUND_IMAGE} ({BORDER_COLOR}) ({BORDER_COLOR_DARK}) ({HIGHLIGHT_LINE_COLOR}) ({IPF}) } #enddef #define _GUI_RESOLUTION RESOLUTION SIZE IMAGE IMAGE_OVERLAY IPF [resolution] {RESOLUTION} min_width = {SIZE} min_height = {SIZE} default_width = {SIZE} default_height = {SIZE} max_width = {SIZE} max_height = {SIZE} [state_enabled] [draw] [image] w = "(width)" h = "(height)" name = {IMAGE} + ".png{IPF}" [/image] [image] {GUI_CENTERED_IMAGE} name = {IMAGE_OVERLAY} + ".png{IPF}" [/image] [/draw] [/state_enabled] [state_disabled] [draw] [image] w = "(width)" h = "(height)" name = {IMAGE} + ".png~GS(){IPF}" [/image] [image] {GUI_CENTERED_IMAGE} name = {IMAGE_OVERLAY} + ".png~GS(){IPF}" [/image] [/draw] [/state_disabled] [state_pressed] [draw] [image] w = {SIZE} h = {SIZE} name = {IMAGE} + "-pressed.png{IPF}" [/image] [image] {GUI_CENTERED_IMAGE} name = {IMAGE_OVERLAY} + "-pressed.png{IPF}" [/image] [/draw] [/state_pressed] [state_focused] [draw] [image] w = "(width)" h = "(height)" name = {IMAGE} + "-active.png{IPF}" [/image] [image] {GUI_CENTERED_IMAGE} name = {IMAGE_OVERLAY} + "-active.png{IPF}" [/image] [/draw] [/state_focused] [state_success] [draw] [image] w = "(width)" h = "(height)" name = {IMAGE} + ".png{IPF}" [/image] [image] {GUI_CENTERED_IMAGE} name = {IMAGE_OVERLAY} + "-success.png{IPF}" [/image] [/draw] [/state_success] [/resolution] #enddef #define _GUI_DEFINITION ID DESCRIPTION IMAGE IMAGE_OVERLAY IPF [button_definition] id = {ID} description = {DESCRIPTION} {_GUI_RESOLUTION () 25 ({IMAGE}) ({IMAGE_OVERLAY}) ({IPF})} [/button_definition] #enddef {_GUI_DEFINITION "action_copy" "Right arrow button for copy-to-clipboard." "buttons/modern/normal/background" "icons/action/copy_25" "~CROP(0,0,25,25)" } # Text only copy button with success indication #define _GUI_BUTTON_TEXT TEXT FONT_SIZE FONT_STYLE FONT_COLOR [text] x = {GUI__TEXT_HORIZONTALLY_CENTRED} y = "(max((height - text_height - 2) / 2, 0))" w = "(text_width)" h = "(text_height)" font_size = {FONT_SIZE} font_style = {FONT_STYLE} color = {FONT_COLOR} text = {TEXT} text_markup = true [/text] #enddef #define _GUI_RESOLUTION_COPY RESOLUTION MIN_WIDTH DEFAULT_WIDTH HEIGHT EXTRA_WIDTH EXTRA_HEIGHT FONT_SIZE IPF ALPHA [resolution] {RESOLUTION} min_width = {MIN_WIDTH} min_height = {HEIGHT} default_width = {DEFAULT_WIDTH} default_height = {HEIGHT} max_width = 0 max_height = {HEIGHT} text_extra_width = {EXTRA_WIDTH} text_extra_height = {EXTRA_HEIGHT} text_font_size = {FONT_SIZE} [state_enabled] [draw] [image] x = 0 y = 0 w = "(width)" h = "(height)" name = "buttons/modern/normal/background.png{IPF}" [/image] {_GUI_BUTTON_TEXT (_"page^Copy") ({FONT_SIZE}) ("bold") ({GUI__FONT_COLOR_ENABLED__WHITE})} [/draw] [/state_enabled] [state_disabled] [draw] [image] x = 0 y = 0 w = "(width)" h = "(height)" name = "buttons/modern/normal/background.png~GS(){IPF}" [/image] {_GUI_BUTTON_TEXT (_"page^Copy") ({FONT_SIZE}) ("bold") ({GUI__FONT_COLOR_DISABLED__WHITE})} [/draw] [/state_disabled] [state_pressed] [draw] [image] x = 0 y = 0 w = "(width)" h = "(height)" name = "buttons/modern/normal/background-pressed.png{IPF}" [/image] {_GUI_BUTTON_TEXT (_"page^Copy") ({FONT_SIZE}) ("bold") ({GUI__FONT_COLOR_ENABLED__WHITE})} [/draw] [/state_pressed] [state_focused] [draw] [image] x = 0 y = 0 w = "(width)" h = "(height)" name = "buttons/modern/normal/background-active.png{IPF}" [/image] {_GUI_BUTTON_TEXT (_"page^Copy") ({FONT_SIZE}) ("bold") ({GUI__FONT_COLOR_ENABLED__WHITE})} [/draw] [/state_focused] [state_success] [draw] [image] x = 0 y = 0 w = "(width)" h = "(height)" name = "buttons/modern/normal/background.png{IPF}" [/image] #po: The heavy checkmark character is available in the DejaVu Sans font, but not in the default Lato font {_GUI_BUTTON_TEXT (_"page^ Copied") ({FONT_SIZE}) () ("0, 255, 0, 255")} [/draw] [/state_success] [/resolution] #enddef [button_definition] id = "copy" description = "Text only copy button with success indication" {_GUI_RESOLUTION_COPY () 40 90 30 20 5 {GUI_FONT_SIZE_SMALL} () 255} [/button_definition] #undef _GUI_STATE #undef _GUI_BUTTON_TEXT #undef _GUI_RESOLUTION #undef _GUI_RESOLUTION_COPY #undef _GUI_DEFINITION