Theme.h header
#include <ew/app/Theme.h>
Namespace ew::app
Theme struct
struct ew::app::Theme
An application colour theme: a named set of palette colours (as "#rrggbb" hex strings, so this stays free of any GUI type) that the desktop client turns into a QPalette. The nine colours are the essential palette roles; the client derives the rest (alternating rows, tooltips, disabled text) from them. dark lets the client adjust derived shades and any dark-mode-specific styling.
Members
QString ew::app::Theme::name
The theme's display name (also its stable identifier, e.g. "Light", "Dark", "Sepia").
bool ew::app::Theme::dark = false
Whether this is a dark theme (a dark window with light text).
QString ew::app::Theme::window
Window/panel background.
QString ew::app::Theme::windowText
Text on the window background.
QString ew::app::Theme::base
Background of text-entry surfaces (editors, fields, lists).
QString ew::app::Theme::text
Text on base surfaces.
QString ew::app::Theme::button
Button background.
QString ew::app::Theme::buttonText
Text on buttons.
QString ew::app::Theme::highlight
Selection/accent background.
QString ew::app::Theme::highlightedText
Text on the selection/accent background.
QString ew::app::Theme::link
Hyperlink colour.
Functions
std::vector< Theme > ew::app::availableThemes(const ContributionRegistry &contributions)
The built-in themes followed by every plugin-contributed theme (contributions), in that order. A contributed theme whose name collides with a built-in or an earlier contribution is skipped, so a plugin can never shadow "Light"/"Dark". This is what the theme picker should iterate.
std::vector< Theme > ew::app::builtInThemes()
The built-in themes shipped with the app, in display order: Light, Dark, Sepia.
Theme ew::app::themeByName(const QString &name)
The built-in theme with name (case-sensitive), or the Light theme when none matches – so a stored theme name that no longer exists falls back gracefully.
Theme ew::app::themeByName(const QString &name, const ContributionRegistry &contributions)
themeByName resolved across availableThemes(contributions): a plugin theme that was selected and persisted still resolves on the next launch. Falls back to the Light theme when no name matches (as themeByName does).
Theme ew::app::themeFromJson(const QByteArray &json)
Parses a theme from json. Missing colour fields become empty strings.
QByteArray ew::app::themeToJson(const Theme &theme)
Serialises theme to JSON bytes.