11 #include <RADCore/RADCore.h>
37 std::string
text =
"#1d2733";
89 std::string
id =
"light";
91 std::string
name =
"Light";
99 std::map<std::string, std::string>
icons;
122 bool loadFromFile(
const std::string& path, std::string* error =
nullptr);
124 bool saveToFile(
const std::string& path, std::string* error =
nullptr)
const;
#define RAD_EVENT(Name, Signature)
Declares a typed RADCore event; example: RAD_EVENT(done, (int)).
Definition: RADCore.h:65
#define RADEvents
Marks a public event declaration block in RADObject-derived classes.
Definition: RADCore.h:43
JSON value supporting null, bool, number, string, array, and object.
Definition: RADCore.h:509
Base class for event receivers, senders, and thread-affinity aware objects.
Definition: RADCore.h:931
Process/application theme manager with RADCore events.
Definition: RADTheme.h:103
bool saveToFile(const std::string &path, std::string *error=nullptr) const
Saves current theme JSON to path.
static std::string modeName(ThemeMode mode)
Converts ThemeMode to stable text.
static Theme darkTheme()
Returns RADUi's default dark theme.
const Theme & theme() const
Returns active theme tokens.
static RADCore::RADJsonValue toJson(const Theme &theme)
Converts a theme to JSON.
ThemeManager()
Creates a manager using the default light theme.
ThemeMode mode() const
Returns current mode.
static Theme fromJson(const RADCore::RADJsonValue &value, const Theme &defaults=lightTheme())
Converts JSON to a theme, using defaults for missing fields.
static ThemeMode modeFromName(const std::string &name)
Parses ThemeMode text.
void setMode(ThemeMode mode)
Sets current theme mode.
bool loadFromFile(const std::string &path, std::string *error=nullptr)
Loads theme JSON from path.
void setTheme(Theme theme)
Replaces active theme tokens.
RADCore::Event< void() > changed
Raised when mode or theme tokens change.
Definition: RADTheme.h:107
static Theme lightTheme()
Returns RADUi's default light theme.
Definition: RADAppKit.h:20
ThemeMode
Theme selection mode.
Definition: RADTheme.h:19
@ Light
Use light theme tokens.
@ Dark
Use dark theme tokens.
@ System
Use the system preference when a backend can report it.
Named UI color tokens encoded as CSS-style strings.
Definition: RADTheme.h:29
std::string panel
Raised panel background.
Definition: RADTheme.h:33
std::string window
Main window background.
Definition: RADTheme.h:31
std::string warning
Warning state color.
Definition: RADTheme.h:47
std::string success
Success state color.
Definition: RADTheme.h:45
std::string panelAlt
Alternate panel background.
Definition: RADTheme.h:35
std::string error
Error state color.
Definition: RADTheme.h:49
std::string border
Border and separator color.
Definition: RADTheme.h:41
std::string mutedText
Muted secondary text color.
Definition: RADTheme.h:39
std::string text
Primary text color.
Definition: RADTheme.h:37
std::string accent
Primary accent color.
Definition: RADTheme.h:43
Spacing/radius tokens in logical pixels.
Definition: RADTheme.h:53
int gapSmall
Small gap.
Definition: RADTheme.h:55
int gap
Normal gap.
Definition: RADTheme.h:57
int padding
Panel/content padding.
Definition: RADTheme.h:61
int toolbarHeight
Standard toolbar height.
Definition: RADTheme.h:65
int statusBarHeight
Standard status bar height.
Definition: RADTheme.h:67
int gapLarge
Large gap.
Definition: RADTheme.h:59
int radius
Border radius.
Definition: RADTheme.h:63
Typography tokens.
Definition: RADTheme.h:71
std::string monoFamily
Preferred monospace font family.
Definition: RADTheme.h:83
int monoSize
Monospace text size.
Definition: RADTheme.h:79
int headingSize
Heading size.
Definition: RADTheme.h:77
std::string bodyFamily
Preferred normal font family.
Definition: RADTheme.h:81
int bodySize
Normal text size.
Definition: RADTheme.h:73
int labelSize
Compact label size.
Definition: RADTheme.h:75
Complete RADUi theme definition.
Definition: RADTheme.h:87
std::string name
Display name.
Definition: RADTheme.h:91
ThemeTypography typography
Typography tokens.
Definition: RADTheme.h:97
ThemeColors colors
Color tokens.
Definition: RADTheme.h:93
std::map< std::string, std::string > icons
Icon name aliases.
Definition: RADTheme.h:99
ThemeMetrics metrics
Metrics tokens.
Definition: RADTheme.h:95