Loading...
Searching...
No Matches
InputTheme.h
Go to the documentation of this file.
1//
2// InputTheme.h
3//
4
5#ifndef MALENA_INPUTTHEME_H
6#define MALENA_INPUTTHEME_H
7
8#pragma once
9
12
13namespace ml
14{
25 {
26 sf::Color bgIdle = sf::Color(40, 40, 40);
29 sf::Color borderIdle = sf::Color(100, 100, 100);
34 float borderThickness = 1.5f;
35
36 // ── applyFrom ─────────────────────────────────────────────────────────
37
38 InputTheme& applyFrom(const Theme& t) override
39 {
41 bgIdle = t.surface;
43 std::min(255, t.surface.r + 10),
44 std::min(255, t.surface.g + 10),
45 std::min(255, t.surface.b + 10));
53 return *this;
54 }
55
56 // ── Assignment from parent levels ─────────────────────────────────────
57
59 { static_cast<ControlTheme&>(*this) = c; return *this; }
60
62 { static_cast<ControlTheme&>(*this) = g; return *this; }
63
64 // ── Getters / setters ─────────────────────────────────────────────────
65
66 [[nodiscard]] sf::Color getBgIdle() const { return bgIdle; }
67 [[nodiscard]] sf::Color getBgFocused() const { return bgFocused; }
68 [[nodiscard]] sf::Color getBgDisabled() const { return bgDisabled; }
69 [[nodiscard]] sf::Color getBorderIdle() const { return borderIdle; }
70 [[nodiscard]] sf::Color getBorderFocused() const { return borderFocused; }
71 [[nodiscard]] sf::Color getBorderError() const { return borderError; }
72 [[nodiscard]] sf::Color getBorderDisabled() const { return borderDisabled; }
73 [[nodiscard]] sf::Color getPlaceholderColor() const { return placeholderColor; }
74 [[nodiscard]] float getBorderThickness() const { return borderThickness; }
75
76 void setBgIdle(const sf::Color& c) { bgIdle = c; }
77 void setBgFocused(const sf::Color& c) { bgFocused = c; }
78 void setBgDisabled(const sf::Color& c) { bgDisabled = c; }
79 void setBorderIdle(const sf::Color& c) { borderIdle = c; }
81 void setBorderError(const sf::Color& c) { borderError = c; }
84 void setBorderThickness(float t) { borderThickness = t; }
85 };
86
87} // namespace ml
88
89#endif // MALENA_INPUTTHEME_H
std::uint8_t b
std::uint8_t g
std::uint8_t r
Definition Component.h:22
Theme tokens for interactive UI controls.
ControlTheme & applyFrom(const Theme &t) override
Populate all fields from the global Theme token set.
Theme tokens for all visual components.
Color and font tokens shared by all input controls.
Definition InputTheme.h:25
void setBgIdle(const sf::Color &c)
Definition InputTheme.h:76
void setBgDisabled(const sf::Color &c)
Definition InputTheme.h:78
sf::Color bgFocused
Definition InputTheme.h:27
sf::Color getBorderIdle() const
Definition InputTheme.h:69
void setPlaceholderColor(const sf::Color &c)
Definition InputTheme.h:83
void setBgFocused(const sf::Color &c)
Definition InputTheme.h:77
void setBorderFocused(const sf::Color &c)
Definition InputTheme.h:80
void setBorderDisabled(const sf::Color &c)
Definition InputTheme.h:82
sf::Color getBgFocused() const
Definition InputTheme.h:67
InputTheme & operator=(const GraphicTheme &g)
Definition InputTheme.h:61
InputTheme & operator=(const ControlTheme &c)
Definition InputTheme.h:58
sf::Color bgIdle
Definition InputTheme.h:26
sf::Color getBorderError() const
Definition InputTheme.h:71
float borderThickness
Definition InputTheme.h:34
sf::Color getBorderFocused() const
Definition InputTheme.h:70
sf::Color bgDisabled
Definition InputTheme.h:28
void setBorderError(const sf::Color &c)
Definition InputTheme.h:81
sf::Color getPlaceholderColor() const
Definition InputTheme.h:73
sf::Color getBgIdle() const
Definition InputTheme.h:66
sf::Color getBgDisabled() const
Definition InputTheme.h:68
sf::Color borderIdle
Definition InputTheme.h:29
void setBorderIdle(const sf::Color &c)
Definition InputTheme.h:79
sf::Color getBorderDisabled() const
Definition InputTheme.h:72
void setBorderThickness(float t)
Definition InputTheme.h:84
sf::Color placeholderColor
Definition InputTheme.h:33
float getBorderThickness() const
Definition InputTheme.h:74
InputTheme & applyFrom(const Theme &t) override
Populate all fields from the global Theme token set.
Definition InputTheme.h:38
sf::Color borderError
Definition InputTheme.h:31
sf::Color borderDisabled
Definition InputTheme.h:32
sf::Color borderFocused
Definition InputTheme.h:30
Universal design token set applied across all Themeable components.
Definition Theme.h:70
sf::Color border
Definition Theme.h:98
sf::Color error
Definition Theme.h:104
float borderThickness
Definition Theme.h:138
sf::Color disabled
Definition Theme.h:110
sf::Color muted
Definition Theme.h:95
sf::Color borderFocus
Definition Theme.h:101
sf::Color surface
Definition Theme.h:80