Loading...
Searching...
No Matches
Theme.h
Go to the documentation of this file.
1//
2// Theme.h
3//
4
5#ifndef MALENA_THEME_H
6#define MALENA_THEME_H
7
8#pragma once
9
10// #include <Malena/Resources/FontManager.h>
15namespace ml
16{
17 // ── Theme ─────────────────────────────────────────────────────────────────
18
69 struct Theme : ThemeTag
70 {
71 // ── Color roles ───────────────────────────────────────────────────────
72
74 sf::Color primary = sf::Color(100, 60, 200);
75
77 sf::Color secondary = sf::Color(70, 130, 230);
78
81
84
87
90
93
95 sf::Color muted = sf::Color(120, 120, 120);
96
98 sf::Color border = sf::Color(100, 100, 100);
99
102
104 sf::Color error = sf::Color(220, 70, 70);
105
107 sf::Color success = sf::Color(70, 200, 100);
108
111
114
115 // ── Typography ────────────────────────────────────────────────────────
116
118 const sf::Font* font = nullptr;
119
121 unsigned int fontSize = 14;
122
124 unsigned int fontSizeSmall= 11;
125
127 unsigned int fontSizeLarge= 18;
128
129 // ── Geometry ─────────────────────────────────────────────────────────
130
132 float radius = 8.f;
133
135 float spacing = 8.f;
136
138 float borderThickness = 1.5f;
139
140 // ── Virtual destructor for safe inheritance ───────────────────────────
141 virtual ~Theme() = default;
142 };
143
144 // ── Built-in themes ───────────────────────────────────────────────────────
145
155 {
157 {
158 primary = sf::Color(100, 60, 200);
159 secondary = sf::Color(70, 130, 230);
160 surface = sf::Color(40, 40, 40);
161 background = sf::Color(20, 20, 20);
164 onBackground = sf::Color(220, 220, 220);
165 muted = sf::Color(120, 120, 120);
166 border = sf::Color(100, 100, 100);
167 borderFocus = sf::Color(100, 60, 200);
168 error = sf::Color(220, 70, 70);
169 success = sf::Color(70, 200, 100);
170 disabled = sf::Color(60, 60, 60);
171 onDisabled = sf::Color(120, 120, 120);
172 radius = 8.f;
173 spacing = 8.f;
174 borderThickness = 1.5f;
175 }
176 };
177
184 {
186 {
187 primary = sf::Color(100, 60, 200);
188 secondary = sf::Color(70, 130, 230);
189 surface = sf::Color(245, 245, 248);
190 background = sf::Color(255, 255, 255);
191 onSurface = sf::Color(20, 20, 20);
193 onBackground = sf::Color(40, 40, 40);
194 muted = sf::Color(150, 150, 150);
195 border = sf::Color(200, 200, 200);
196 borderFocus = sf::Color(100, 60, 200);
197 error = sf::Color(200, 50, 50);
198 success = sf::Color(50, 180, 80);
199 disabled = sf::Color(220, 220, 220);
200 onDisabled = sf::Color(160, 160, 160);
201 radius = 8.f;
202 spacing = 8.f;
203 borderThickness = 1.f;
204 }
205 };
206
207} // namespace ml
208
209#endif // MALENA_THEME_H
static const Color White
Definition Component.h:22
Universal design token set applied across all Themeable components.
Definition Theme.h:70
sf::Color border
Definition Theme.h:98
virtual ~Theme()=default
float spacing
Definition Theme.h:135
unsigned int fontSize
Definition Theme.h:121
sf::Color success
Definition Theme.h:107
sf::Color onPrimary
Definition Theme.h:89
sf::Color error
Definition Theme.h:104
float borderThickness
Definition Theme.h:138
const sf::Font * font
Definition Theme.h:118
unsigned int fontSizeSmall
Definition Theme.h:124
sf::Color primary
Definition Theme.h:74
sf::Color onSurface
Definition Theme.h:86
float radius
Definition Theme.h:132
sf::Color background
Definition Theme.h:83
sf::Color disabled
Definition Theme.h:110
sf::Color muted
Definition Theme.h:95
sf::Color onDisabled
Definition Theme.h:113
sf::Color borderFocus
Definition Theme.h:101
sf::Color onBackground
Definition Theme.h:92
sf::Color surface
Definition Theme.h:80
sf::Color secondary
Definition Theme.h:77
unsigned int fontSizeLarge
Definition Theme.h:127
Lightweight polymorphic base for all Theme structs.
Definition ThemeTag.h:27