summaryrefslogtreecommitdiff
path: root/data/graphics/gui/theme.xml
AgeCommit message (Collapse)AuthorFilesLines
2025-04-02General code cleanupsThorbjørn Lindeijer1-0/+25
* Removed some unused includes and forward declarations. * Use std::unique_ptr to automate cleanup. * Use TextRenderer::renderText in BrowserBox to avoid code duplication. * Removed unused STATE_NORMAL from StateFlags. * Small layout fix in ServerDialog. * Reduced rewrapping delay in BrowserBox to 33ms and disabled it entirely when there are no more than 1000 lines to rewrap. The rewrapping is usually fast enough.
2025-04-01GUI: Made CheckBox, RadioButton and Slider more customizableThorbjørn Lindeijer1-14/+14
Added handling of padding and text format and added new "spacing" skin variable which is used for the space between the label and the control in case of CheckBox and RadioButton. Small tweaks to UI layout in various places.
2025-03-31GUI: Support customizing widget text format through themeThorbjørn Lindeijer1-4/+2
The following widgets now support setting the font, text color, outline color and shadow color through the theme: * Button * Tab * Window (title) * ProgressBar The text format can be specified differently per skin state.
2025-03-31GUI: De-hardcode the window title offsetsThorbjørn Lindeijer1-1/+1
2025-03-24Added fill mode parameter to ImageRectThorbjørn Lindeijer1-7/+7
ImageRect now stretches the sides and center images by default because this is more efficient these days. FilMode::Repeat can be specified when repetition is desired. Added 'fill' attribute to allow the fill mode to be specified for the GUI theme images.
2025-03-24Expanded GUI theming capabilitiesThorbjørn Lindeijer1-11/+34
* Moved previously hardcoded values for frame size, padding and title bar height to the Skin. * Added support for rendering colored rectangles (used for scroll bar background). * Scroll bar width is now determined by its skin. * Added separate skins for horizontal and vertical scroll bars and horizontal and vertical scroll markers and added a skin for the shortcut box. * Added support for hovered state on window close button.
2025-03-24Define the GUI theme in XMLThorbjørn Lindeijer1-0/+234
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 `<img>` 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 `<state>` 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.