From 5274cc92c1055a3209dfae7e5346bfe52c35e4a8 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Mon, 17 Mar 2025 10:39:38 +0100 Subject: Define the GUI theme in XML Now all images used by the various UI widgets are defined in a `theme.xml`, removing hardcoded requirements on the size of images, borders and sub-images and their locations. The `colors.xml` file was merged into this new file as well. The `` element defines either a plain image, or a 9-scale that is automatically rendered at the size of the widget when any of the `left`, `right`, `top` or `bottom` attributes are given. The `x`, `y`, `width` and `height` attributes determine the sub-rectangle within the image referenced by `src`. `x` and `y` default to 0 and `width` and `height` default to the imge size. The `` element defines in which state its images are used by setting its `selected`, `disabled`, `hovered` or `focused` attributes to either `true` or `false`. Only the first matching state is rendered. The `Text` and `SpeechBubble` classes now use the same skin to draw the bubble, as well as using a newly introduced `BUBBLE_TEXT` color from the theme palette. --- data/graphics/gui/colors.xml | 50 -------- data/graphics/gui/speechbubble.xml | 18 --- data/graphics/gui/theme.xml | 234 +++++++++++++++++++++++++++++++++++++ data/graphics/gui/window.xml | 18 --- 4 files changed, 234 insertions(+), 86 deletions(-) delete mode 100644 data/graphics/gui/colors.xml delete mode 100644 data/graphics/gui/speechbubble.xml create mode 100644 data/graphics/gui/theme.xml delete mode 100644 data/graphics/gui/window.xml (limited to 'data') diff --git a/data/graphics/gui/colors.xml b/data/graphics/gui/colors.xml deleted file mode 100644 index 4a35d081..00000000 --- a/data/graphics/gui/colors.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/graphics/gui/speechbubble.xml b/data/graphics/gui/speechbubble.xml deleted file mode 100644 index 84b6557b..00000000 --- a/data/graphics/gui/speechbubble.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/data/graphics/gui/theme.xml b/data/graphics/gui/theme.xml new file mode 100644 index 00000000..652a9422 --- /dev/null +++ b/data/graphics/gui/theme.xml @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/graphics/gui/window.xml b/data/graphics/gui/window.xml deleted file mode 100644 index f27dbc7f..00000000 --- a/data/graphics/gui/window.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - -- cgit v1.2.3-70-g09d2