载入中...
搜索中...
未找到
Theme.cpp
浏览该文件的文档.
1#include "ui/Theme.h"
2
3#include <imgui.h>
4
5#include <algorithm>
6#include <cctype>
7#include <unordered_map>
8#include <unordered_set>
9
10namespace eve::ui {
11namespace {
12
13Theme g_theme = Theme::dark();
14std::string g_themeName = "dark";
15float g_uiScale = 1.f;
16float g_dpiScale = 1.f;
17std::unordered_map<std::string, StyleClass> g_styleClasses;
18
19void copy4(float dst[4], const float src[4]) {
20 dst[0] = src[0];
21 dst[1] = src[1];
22 dst[2] = src[2];
23 dst[3] = src[3];
24}
25
26void setCol(ImGuiStyle &style, ImGuiCol idx, const float c[4]) {
27 style.Colors[idx] = ImVec4(c[0], c[1], c[2], c[3]);
28}
29
30std::string toLower(std::string s) {
31 for (char &ch : s) ch = static_cast<char>(std::tolower(static_cast<unsigned char>(ch)));
32 return s;
33}
34
35void overlayStyle(StyleClass &dst, const StyleClass &src) {
36 if (src.hasTextColor) {
37 dst.hasTextColor = true;
38 copy4(dst.textColor, src.textColor);
39 }
40 if (src.hasBackgroundColor) {
41 dst.hasBackgroundColor = true;
42 copy4(dst.backgroundColor, src.backgroundColor);
43 }
44 if (src.hasBorderColor) {
45 dst.hasBorderColor = true;
46 copy4(dst.borderColor, src.borderColor);
47 }
48 if (src.hasAccentColor) {
49 dst.hasAccentColor = true;
50 copy4(dst.accentColor, src.accentColor);
51 }
52 if (src.hasPadding) {
53 dst.hasPadding = true;
54 dst.paddingX = src.paddingX;
55 dst.paddingY = src.paddingY;
56 }
57 if (src.hasRounding) {
58 dst.hasRounding = true;
59 dst.rounding = src.rounding;
60 }
61 if (src.hasAlpha) {
62 dst.hasAlpha = true;
63 dst.alpha = src.alpha;
64 }
65}
66
67bool resolveStyle(const std::string &name, StyleClass &out,
68 std::unordered_set<std::string> &visiting) {
69 const auto it = g_styleClasses.find(name);
70 if (it == g_styleClasses.end() || !visiting.insert(name).second) return false;
71 const StyleClass &source = it->second;
72 if (!source.parent.empty() && !resolveStyle(source.parent, out, visiting)) return false;
73 overlayStyle(out, source);
74 out.name = source.name;
75 out.parent = source.parent;
76 visiting.erase(name);
77 return true;
78}
79
80} // namespace
81
82StyleClassStatus defineStyleClass(const std::string &name, const std::string &parent) {
83 if (name.empty()) return StyleClassStatus::InvalidName;
84 if (!parent.empty() && g_styleClasses.find(parent) == g_styleClasses.end())
86 for (std::string current = parent; !current.empty();) {
88 const auto it = g_styleClasses.find(current);
89 if (it == g_styleClasses.end()) return StyleClassStatus::UnknownParent;
90 current = it->second.parent;
91 }
92 StyleClass replacement;
93 replacement.name = name;
94 replacement.parent = parent;
95 g_styleClasses[name] = std::move(replacement);
97}
98
99StyleClassStatus setStyleClassColor(const std::string &name, const std::string &property, float r,
100 float g, float b, float a) {
101 const auto it = g_styleClasses.find(name);
102 if (it == g_styleClasses.end()) return StyleClassStatus::UnknownClass;
103 StyleClass &style = it->second;
104 float *color = nullptr;
105 const std::string key = toLower(property);
106 if (key == "text") {
107 style.hasTextColor = true;
108 color = style.textColor;
109 } else if (key == "background") {
110 style.hasBackgroundColor = true;
111 color = style.backgroundColor;
112 } else if (key == "border") {
113 style.hasBorderColor = true;
114 color = style.borderColor;
115 } else if (key == "accent") {
116 style.hasAccentColor = true;
117 color = style.accentColor;
118 } else {
120 }
121 color[0] = std::clamp(r, 0.f, 1.f);
122 color[1] = std::clamp(g, 0.f, 1.f);
123 color[2] = std::clamp(b, 0.f, 1.f);
124 color[3] = std::clamp(a, 0.f, 1.f);
126}
127
128StyleClassStatus setStyleClassMetric(const std::string &name, const std::string &property, float x,
129 float y) {
130 const auto it = g_styleClasses.find(name);
131 if (it == g_styleClasses.end()) return StyleClassStatus::UnknownClass;
132 StyleClass &style = it->second;
133 const std::string key = toLower(property);
134 if (key == "padding") {
135 style.hasPadding = true;
136 style.paddingX = std::max(0.f, x);
137 style.paddingY = std::max(0.f, y);
138 } else if (key == "rounding") {
139 style.hasRounding = true;
140 style.rounding = std::max(0.f, x);
141 } else if (key == "alpha") {
142 style.hasAlpha = true;
143 style.alpha = std::clamp(x, 0.f, 1.f);
144 } else {
146 }
148}
149
151 if (!out || name.empty()) return StyleClassStatus::InvalidName;
152 if (g_styleClasses.find(name) == g_styleClasses.end()) return StyleClassStatus::UnknownClass;
153 StyleClass resolved;
154 std::unordered_set<std::string> visiting;
155 if (!resolveStyle(name, resolved, visiting)) return StyleClassStatus::InheritanceCycle;
156 *out = std::move(resolved);
158}
159
160void clearStyleClasses() { g_styleClasses.clear(); }
161
163 switch (status) {
164 case StyleClassStatus::Applied: return "applied";
165 case StyleClassStatus::InvalidName: return "invalid-name";
166 case StyleClassStatus::UnknownParent: return "unknown-parent";
167 case StyleClassStatus::UnknownClass: return "unknown-class";
168 case StyleClassStatus::UnknownProperty: return "unknown-property";
169 case StyleClassStatus::InheritanceCycle: return "inheritance-cycle";
170 }
171 return "unknown";
172}
173
175 Theme t;
176 // Defaults in Theme already describe the dark preset.
177 return t;
178}
179
181 Theme t;
182 // Shared geometry / typography with dark — only the palette changes.
183 const float text[4] = {0.12f, 0.14f, 0.18f, 1.f};
184 const float textDisabled[4] = {0.45f, 0.48f, 0.52f, 1.f};
185 const float windowBg[4] = {0.94f, 0.95f, 0.97f, 1.f};
186 const float childBg[4] = {0.90f, 0.92f, 0.95f, 1.f};
187 const float popupBg[4] = {0.98f, 0.98f, 0.99f, 0.98f};
188 const float border[4] = {0.55f, 0.58f, 0.62f, 0.55f};
189 const float borderShadow[4] = {0.f, 0.f, 0.f, 0.f};
190 const float frameBg[4] = {0.86f, 0.88f, 0.92f, 1.f};
191 const float frameBgHovered[4] = {0.80f, 0.84f, 0.90f, 1.f};
192 const float frameBgActive[4] = {0.74f, 0.80f, 0.88f, 1.f};
193 const float titleBg[4] = {0.88f, 0.90f, 0.94f, 1.f};
194 const float titleBgActive[4] = {0.72f, 0.82f, 0.95f, 1.f};
195 const float titleBgCollapsed[4] = {0.90f, 0.92f, 0.95f, 0.85f};
196 const float menuBarBg[4] = {0.90f, 0.92f, 0.95f, 1.f};
197 const float button[4] = {0.26f, 0.52f, 0.90f, 0.65f};
198 const float buttonHovered[4] = {0.28f, 0.55f, 0.95f, 1.f};
199 const float buttonActive[4] = {0.18f, 0.42f, 0.82f, 1.f};
200 const float header[4] = {0.26f, 0.52f, 0.90f, 0.35f};
201 const float headerHovered[4] = {0.28f, 0.55f, 0.95f, 0.55f};
202 const float headerActive[4] = {0.26f, 0.52f, 0.90f, 0.80f};
203 const float checkMark[4] = {0.18f, 0.42f, 0.82f, 1.f};
204 const float sliderGrab[4] = {0.30f, 0.55f, 0.92f, 0.90f};
205 const float sliderGrabActive[4] = {0.22f, 0.48f, 0.88f, 1.f};
206 const float separator[4] = {0.60f, 0.62f, 0.66f, 0.55f};
207 const float scrollbarBg[4] = {0.85f, 0.87f, 0.90f, 0.60f};
208 const float scrollbarGrab[4] = {0.55f, 0.58f, 0.62f, 0.80f};
209 const float scrollbarGrabHovered[4] = {0.45f, 0.48f, 0.52f, 0.90f};
210 const float scrollbarGrabActive[4] = {0.35f, 0.38f, 0.42f, 1.f};
211 const float tab[4] = {0.86f, 0.89f, 0.93f, 1.f};
212 const float tabHovered[4] = {0.68f, 0.84f, 0.91f, 1.f};
213 const float tabActive[4] = {0.76f, 0.87f, 0.92f, 1.f};
214 const float tabUnfocused[4] = {0.89f, 0.91f, 0.94f, 1.f};
215 const float tabUnfocusedActive[4] = {0.82f, 0.88f, 0.91f, 1.f};
216 const float tableHeaderBg[4] = {0.84f, 0.87f, 0.91f, 1.f};
217 const float tableBorderStrong[4] = {0.48f, 0.53f, 0.59f, 0.72f};
218 const float tableBorderLight[4] = {0.65f, 0.69f, 0.74f, 0.62f};
219 const float tableRowBg[4] = {0.f, 0.f, 0.f, 0.f};
220 const float tableRowBgAlt[4] = {0.52f, 0.62f, 0.72f, 0.10f};
221 const float plotLines[4] = {0.38f, 0.43f, 0.49f, 1.f};
222 const float plotLinesHovered[4] = {0.10f, 0.48f, 0.62f, 1.f};
223 const float plotHistogram[4] = {0.82f, 0.50f, 0.18f, 1.f};
224 const float plotHistogramHovered[4] = {0.92f, 0.61f, 0.22f, 1.f};
225 const float textSelectedBg[4] = {0.20f, 0.55f, 0.68f, 0.30f};
226 const float navHighlight[4] = {0.12f, 0.48f, 0.62f, 0.82f};
227 const float modalDimBg[4] = {0.10f, 0.13f, 0.17f, 0.38f};
228
229 copy4(t.text, text);
230 copy4(t.textDisabled, textDisabled);
231 copy4(t.windowBg, windowBg);
232 copy4(t.childBg, childBg);
233 copy4(t.popupBg, popupBg);
234 copy4(t.border, border);
235 copy4(t.borderShadow, borderShadow);
236 copy4(t.frameBg, frameBg);
237 copy4(t.frameBgHovered, frameBgHovered);
238 copy4(t.frameBgActive, frameBgActive);
239 copy4(t.titleBg, titleBg);
240 copy4(t.titleBgActive, titleBgActive);
241 copy4(t.titleBgCollapsed, titleBgCollapsed);
242 copy4(t.menuBarBg, menuBarBg);
243 copy4(t.button, button);
244 copy4(t.buttonHovered, buttonHovered);
245 copy4(t.buttonActive, buttonActive);
246 copy4(t.header, header);
247 copy4(t.headerHovered, headerHovered);
248 copy4(t.headerActive, headerActive);
249 copy4(t.checkMark, checkMark);
250 copy4(t.sliderGrab, sliderGrab);
251 copy4(t.sliderGrabActive, sliderGrabActive);
252 copy4(t.separator, separator);
253 copy4(t.scrollbarBg, scrollbarBg);
254 copy4(t.scrollbarGrab, scrollbarGrab);
255 copy4(t.scrollbarGrabHovered, scrollbarGrabHovered);
256 copy4(t.scrollbarGrabActive, scrollbarGrabActive);
257 copy4(t.tab, tab);
258 copy4(t.tabHovered, tabHovered);
259 copy4(t.tabActive, tabActive);
260 copy4(t.tabUnfocused, tabUnfocused);
261 copy4(t.tabUnfocusedActive, tabUnfocusedActive);
262 copy4(t.tableHeaderBg, tableHeaderBg);
263 copy4(t.tableBorderStrong, tableBorderStrong);
264 copy4(t.tableBorderLight, tableBorderLight);
265 copy4(t.tableRowBg, tableRowBg);
266 copy4(t.tableRowBgAlt, tableRowBgAlt);
267 copy4(t.plotLines, plotLines);
268 copy4(t.plotLinesHovered, plotLinesHovered);
269 copy4(t.plotHistogram, plotHistogram);
270 copy4(t.plotHistogramHovered, plotHistogramHovered);
271 copy4(t.textSelectedBg, textSelectedBg);
272 copy4(t.navHighlight, navHighlight);
273 copy4(t.modalDimBg, modalDimBg);
274 return t;
275}
276
277Theme &globalTheme() { return g_theme; }
278
279const std::string &globalThemeName() { return g_themeName; }
280
281void setGlobalTheme(const Theme &theme) { setGlobalTheme(theme, "custom"); }
282
283void setGlobalTheme(const Theme &theme, const std::string &name) {
284 g_theme = theme;
285 g_themeName = name.empty() ? "custom" : name;
286}
287
288bool setThemeByName(const std::string &name) {
289 const std::string key = toLower(name);
290 if (key == "dark") {
291 setGlobalTheme(Theme::dark(), "dark");
292 return true;
293 }
294 if (key == "light") {
295 setGlobalTheme(Theme::light(), "light");
296 return true;
297 }
298 return false;
299}
300
302 g_uiScale = std::clamp(scale, 0.5f, 5.f);
303}
304
305float themeUiScale() { return g_uiScale; }
306
307void setThemeDpiScale(float dpiScale) {
308 g_dpiScale = std::clamp(dpiScale, 1.f, 5.f);
309}
310
311float themeDpiScale() { return g_dpiScale; }
312
314
315void applyThemeToImGui(const Theme &theme, float uiScale) {
316 ImGuiContext *ctx = ImGui::GetCurrentContext();
317 if (!ctx) return;
318
319 uiScale = std::clamp(uiScale, 0.5f, 5.f);
320 const float s = uiScale;
321
322 ImGuiStyle &style = ImGui::GetStyle();
323
324 // Colors (independent of scale)
325 setCol(style, ImGuiCol_Text, theme.text);
326 setCol(style, ImGuiCol_TextDisabled, theme.textDisabled);
327 setCol(style, ImGuiCol_WindowBg, theme.windowBg);
328 setCol(style, ImGuiCol_ChildBg, theme.childBg);
329 setCol(style, ImGuiCol_PopupBg, theme.popupBg);
330 setCol(style, ImGuiCol_Border, theme.border);
331 setCol(style, ImGuiCol_BorderShadow, theme.borderShadow);
332 setCol(style, ImGuiCol_FrameBg, theme.frameBg);
333 setCol(style, ImGuiCol_FrameBgHovered, theme.frameBgHovered);
334 setCol(style, ImGuiCol_FrameBgActive, theme.frameBgActive);
335 setCol(style, ImGuiCol_TitleBg, theme.titleBg);
336 setCol(style, ImGuiCol_TitleBgActive, theme.titleBgActive);
337 setCol(style, ImGuiCol_TitleBgCollapsed, theme.titleBgCollapsed);
338 setCol(style, ImGuiCol_MenuBarBg, theme.menuBarBg);
339 setCol(style, ImGuiCol_Button, theme.button);
340 setCol(style, ImGuiCol_ButtonHovered, theme.buttonHovered);
341 setCol(style, ImGuiCol_ButtonActive, theme.buttonActive);
342 setCol(style, ImGuiCol_Header, theme.header);
343 setCol(style, ImGuiCol_HeaderHovered, theme.headerHovered);
344 setCol(style, ImGuiCol_HeaderActive, theme.headerActive);
345 setCol(style, ImGuiCol_CheckMark, theme.checkMark);
346 setCol(style, ImGuiCol_SliderGrab, theme.sliderGrab);
347 setCol(style, ImGuiCol_SliderGrabActive, theme.sliderGrabActive);
348 setCol(style, ImGuiCol_Separator, theme.separator);
349 setCol(style, ImGuiCol_SeparatorHovered, theme.headerHovered);
350 setCol(style, ImGuiCol_SeparatorActive, theme.headerActive);
351 setCol(style, ImGuiCol_ScrollbarBg, theme.scrollbarBg);
352 setCol(style, ImGuiCol_ScrollbarGrab, theme.scrollbarGrab);
353 setCol(style, ImGuiCol_ScrollbarGrabHovered, theme.scrollbarGrabHovered);
354 setCol(style, ImGuiCol_ScrollbarGrabActive, theme.scrollbarGrabActive);
355 setCol(style, ImGuiCol_ResizeGrip, theme.button);
356 setCol(style, ImGuiCol_ResizeGripHovered, theme.buttonHovered);
357 setCol(style, ImGuiCol_ResizeGripActive, theme.buttonActive);
358 setCol(style, ImGuiCol_Tab, theme.tab);
359 setCol(style, ImGuiCol_TabHovered, theme.tabHovered);
360 setCol(style, ImGuiCol_TabActive, theme.tabActive);
361 setCol(style, ImGuiCol_TabUnfocused, theme.tabUnfocused);
362 setCol(style, ImGuiCol_TabUnfocusedActive, theme.tabUnfocusedActive);
363 setCol(style, ImGuiCol_PlotLines, theme.plotLines);
364 setCol(style, ImGuiCol_PlotLinesHovered, theme.plotLinesHovered);
365 setCol(style, ImGuiCol_PlotHistogram, theme.plotHistogram);
366 setCol(style, ImGuiCol_PlotHistogramHovered, theme.plotHistogramHovered);
367 setCol(style, ImGuiCol_TableHeaderBg, theme.tableHeaderBg);
368 setCol(style, ImGuiCol_TableBorderStrong, theme.tableBorderStrong);
369 setCol(style, ImGuiCol_TableBorderLight, theme.tableBorderLight);
370 setCol(style, ImGuiCol_TableRowBg, theme.tableRowBg);
371 setCol(style, ImGuiCol_TableRowBgAlt, theme.tableRowBgAlt);
372 setCol(style, ImGuiCol_TextSelectedBg, theme.textSelectedBg);
373 setCol(style, ImGuiCol_DragDropTarget, theme.checkMark);
374 setCol(style, ImGuiCol_NavHighlight, theme.navHighlight);
375 setCol(style, ImGuiCol_NavWindowingHighlight, theme.text);
376 setCol(style, ImGuiCol_NavWindowingDimBg, theme.modalDimBg);
377 setCol(style, ImGuiCol_ModalWindowDimBg, theme.modalDimBg);
378
379 // Geometry + typography (scaled)
380 style.WindowRounding = theme.windowRounding * s;
381 style.ChildRounding = theme.childRounding * s;
382 style.FrameRounding = theme.frameRounding * s;
383 style.PopupRounding = theme.popupRounding * s;
384 style.ScrollbarRounding = theme.scrollbarRounding * s;
385 style.GrabRounding = theme.grabRounding * s;
386 style.TabRounding = theme.tabRounding * s;
387
388 style.WindowBorderSize = theme.windowBorderSize * s;
389 style.ChildBorderSize = theme.childBorderSize * s;
390 style.PopupBorderSize = theme.popupBorderSize * s;
391 style.FrameBorderSize = theme.frameBorderSize * s;
392
393 style.WindowPadding = ImVec2(theme.windowPaddingX * s, theme.windowPaddingY * s);
394 style.FramePadding = ImVec2(theme.framePaddingX * s, theme.framePaddingY * s);
395 style.ItemSpacing = ImVec2(theme.itemSpacingX * s, theme.itemSpacingY * s);
396 style.ItemInnerSpacing = ImVec2(theme.itemInnerSpacingX * s, theme.itemInnerSpacingY * s);
397 style.CellPadding = ImVec2(theme.cellPaddingX * s, theme.cellPaddingY * s);
398 style.IndentSpacing = theme.indentSpacing * s;
399 style.ScrollbarSize = theme.scrollbarSize * s;
400 style.GrabMinSize = theme.grabMinSize * s;
401
402 ImGuiIO &io = ImGui::GetIO();
403 // The font atlas is rasterized at `baseSize * dpiScale` so glyphs stay
404 // crisp on HiDPI displays, but ImGui already scales the whole frame by
405 // io.DisplayFramebufferScale (which is the same DPI ratio). Cancelling it
406 // here keeps the logical text size constant across display densities, so
407 // the UI no longer double-scales (appears too large) on high-res screens.
408 // FontGlobalScale carries the logical UI scale (uiScale) on top of the
409 // user's per-theme font preference (theme.fontScale).
410 const float dpi = std::clamp(g_dpiScale, 1.f, 5.f);
411 io.FontGlobalScale = theme.fontScale * (s / dpi);
412
413 if (theme.navEnableKeyboard) io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
414 else io.ConfigFlags &= ~ImGuiConfigFlags_NavEnableKeyboard;
415 if (theme.navEnableGamepad) io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
416 else io.ConfigFlags &= ~ImGuiConfigFlags_NavEnableGamepad;
417}
418
419} // namespace eve::ui
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
const std::string & s
Object::Ptr theme
tensor::Graph g
Definition GpuGraph.cpp:7
std::uint32_t key
wgpu::PopErrorScopeStatus status
double r
std::int32_t c
std::array< float, 3 > scale
std::int32_t parent
std::string name
MeleePoint3 b
Definition MeleeHit.cpp:41
MeleePoint3 a
Definition MeleeHit.cpp:40
int idx
float t
double current
std::set< std::string > visiting
const UnitySourceAsset & source
StyleClassStatus defineStyleClass(const std::string &name, const std::string &parent)
Declares or replaces one sparse style class. @thread UI thread only. @reentrancy Does not invoke call...
Definition Theme.cpp:82
float themeDpiScale()
Theme dpi scale.
Definition Theme.cpp:311
StyleClassStatus
Explicit result of a style-registry mutation.
Definition Theme.h:152
const std::string & globalThemeName()
Current preset name: "dark", "light", or "custom".
Definition Theme.cpp:279
void clearStyleClasses()
Clears user-defined style classes. Intended for runtime/test teardown.
Definition Theme.cpp:160
void setThemeDpiScale(float dpiScale)
Sets the theme dpi scale.
Definition Theme.cpp:307
bool setThemeByName(const std::string &name)
Apply a named preset ("dark" / "light"). Case-insensitive. Returns false if unknown.
Definition Theme.cpp:288
void setThemeUiScale(float scale)
Logical (point-space) UI scale. Default 1.0.
Definition Theme.cpp:301
StyleClassStatus setStyleClassMetric(const std::string &name, const std::string &property, float x, float y)
Sets padding, rounding, or alpha on an existing style class.
Definition Theme.cpp:128
const char * styleClassStatusName(StyleClassStatus status)
Stable script-facing spelling of a mutation status.
Definition Theme.cpp:162
void setGlobalTheme(const Theme &theme)
Sets the global theme.
Definition Theme.cpp:281
StyleClassStatus resolveStyleClass(const std::string &name, StyleClass *out)
Resolves inheritance into a sparse class and reports an explicit lookup status.
Definition Theme.cpp:150
Theme & globalTheme()
Global theme.
Definition Theme.cpp:277
void applyThemeToImGui(const Theme &theme)
Push tokens into ImGui style. Metrics are multiplied by uiScale (default: themeUiScale()).
Definition Theme.cpp:313
float themeUiScale()
Theme ui scale.
Definition Theme.cpp:305
StyleClassStatus setStyleClassColor(const std::string &name, const std::string &property, float r, float g, float b, float a)
Sets text/background/border/accent RGBA on an existing style class.
Definition Theme.cpp:99
Sparse reusable widget style resolved once while a retained tree is built.
Definition Theme.h:131
float backgroundColor[4]
Definition Theme.h:139
std::string name
Definition Theme.h:132
std::string parent
Definition Theme.h:133
float accentColor[4]
Definition Theme.h:141
bool hasBackgroundColor
Definition Theme.h:135
float textColor[4]
Definition Theme.h:138
float borderColor[4]
Definition Theme.h:140
Unified UI design tokens (colors, geometry, typography). Applied to ImGui each frame via applyThemeTo...
Definition Theme.h:39
float titleBg[4]
Definition Theme.h:54
float tableBorderLight[4]
Definition Theme.h:79
float navHighlight[4]
Definition Theme.h:87
float frameBg[4]
Definition Theme.h:51
float checkMark[4]
Definition Theme.h:64
float sliderGrab[4]
Definition Theme.h:65
float scrollbarGrab[4]
Definition Theme.h:69
float buttonHovered[4]
Definition Theme.h:59
float tableRowBgAlt[4]
Definition Theme.h:81
float menuBarBg[4]
Definition Theme.h:57
float buttonActive[4]
Definition Theme.h:60
float modalDimBg[4]
Definition Theme.h:88
float textDisabled[4]
Definition Theme.h:45
float separator[4]
Definition Theme.h:67
float titleBgActive[4]
Definition Theme.h:55
float popupBg[4]
Definition Theme.h:48
float tabActive[4]
Definition Theme.h:74
float header[4]
Definition Theme.h:61
float plotHistogram[4]
Definition Theme.h:84
float titleBgCollapsed[4]
Definition Theme.h:56
float scrollbarGrabHovered[4]
Definition Theme.h:70
float tableHeaderBg[4]
Definition Theme.h:77
float text[4]
Definition Theme.h:44
float scrollbarGrabActive[4]
Definition Theme.h:71
float borderShadow[4]
Definition Theme.h:50
float frameBgActive[4]
Definition Theme.h:53
float windowBg[4]
Definition Theme.h:46
float tabUnfocusedActive[4]
Definition Theme.h:76
static Theme light()
Light.
Definition Theme.cpp:180
float tabUnfocused[4]
Definition Theme.h:75
float sliderGrabActive[4]
Definition Theme.h:66
float headerHovered[4]
Definition Theme.h:62
float tabHovered[4]
Definition Theme.h:73
float frameBgHovered[4]
Definition Theme.h:52
float textSelectedBg[4]
Definition Theme.h:86
float plotLinesHovered[4]
Definition Theme.h:83
float tab[4]
Definition Theme.h:72
float childBg[4]
Definition Theme.h:47
float plotLines[4]
Definition Theme.h:82
float headerActive[4]
Definition Theme.h:63
float button[4]
Definition Theme.h:58
float scrollbarBg[4]
Definition Theme.h:68
float plotHistogramHovered[4]
Definition Theme.h:85
float tableBorderStrong[4]
Definition Theme.h:78
static Theme dark()
Built-in presets with matching geometry; only colors differ.
Definition Theme.cpp:174
float border[4]
Definition Theme.h:49
float tableRowBg[4]
Definition Theme.h:80
glm::vec4 color