Loading...
Searching...
No Matches
ButtonTheme.h
Go to the documentation of this file.
1//
2// ButtonTheme.h
3//
4
5#ifndef MALENA_BUTTONTHEME_H
6#define MALENA_BUTTONTHEME_H
7
8#pragma once
9
12
13namespace ml
14{
15 // ── ButtonTheme ───────────────────────────────────────────────────────────
16
28 {
29 sf::Color onColor = sf::Color(100, 60, 200);
34 float borderThickness = 1.5f;
35 float buttonRadius = 8.f;
36
37 // ── applyFrom ─────────────────────────────────────────────────────────
38
39 ButtonTheme& applyFrom(const Theme& t) override
40 {
42 onColor = t.primary;
43 offColor = t.surface;
49 return *this;
50 }
51
52 // ── Assignment from parent levels ─────────────────────────────────────
53
55 {
56 static_cast<ToggleTheme&>(*this) = t;
57 return *this;
58 }
59
61 {
62 static_cast<ToggleTheme&>(*this) = c;
63 return *this;
64 }
65
67 {
68 static_cast<ToggleTheme&>(*this) = g;
69 return *this;
70 }
71
72 // ── Getters / setters ─────────────────────────────────────────────────
73
74 [[nodiscard]] sf::Color getOnColor() const { return onColor; }
75 [[nodiscard]] sf::Color getOffColor() const { return offColor; }
76 [[nodiscard]] sf::Color getOnTextColor() const { return onTextColor; }
77 [[nodiscard]] sf::Color getOffTextColor() const { return offTextColor; }
78 [[nodiscard]] sf::Color getBorderColor() const { return borderColor; }
79 [[nodiscard]] float getBorderThickness() const { return borderThickness; }
80 [[nodiscard]] float getButtonRadius() const { return buttonRadius; }
81
82 void setOnColor(const sf::Color& c) { onColor = c; }
83 void setOffColor(const sf::Color& c) { offColor = c; }
84 void setOnTextColor(const sf::Color& c) { onTextColor = c; }
85 void setOffTextColor(const sf::Color& c) { offTextColor = c; }
86 void setBorderColor(const sf::Color& c) { borderColor = c; }
87 void setBorderThickness(float t) { borderThickness = t; }
88 void setButtonRadius(float r) { buttonRadius = r; }
89 };
90
91} // namespace ml
92
93#endif // MALENA_BUTTONTHEME_H
static const Color White
Definition Component.h:22
Theme tokens for the ButtonToggle (rectangular toggle button).
Definition ButtonTheme.h:28
void setBorderThickness(float t)
Definition ButtonTheme.h:87
ButtonTheme & operator=(const ToggleTheme &t)
Definition ButtonTheme.h:54
ButtonTheme & applyFrom(const Theme &t) override
Populate all fields from the global Theme token set.
Definition ButtonTheme.h:39
float borderThickness
Definition ButtonTheme.h:34
void setOffTextColor(const sf::Color &c)
Definition ButtonTheme.h:85
sf::Color offTextColor
Definition ButtonTheme.h:32
ButtonTheme & operator=(const ControlTheme &c)
Definition ButtonTheme.h:60
sf::Color getOffColor() const
Definition ButtonTheme.h:75
sf::Color getOffTextColor() const
Definition ButtonTheme.h:77
sf::Color getOnColor() const
Definition ButtonTheme.h:74
void setOnColor(const sf::Color &c)
Definition ButtonTheme.h:82
void setOnTextColor(const sf::Color &c)
Definition ButtonTheme.h:84
sf::Color onTextColor
Definition ButtonTheme.h:31
sf::Color onColor
Definition ButtonTheme.h:29
ButtonTheme & operator=(const GraphicTheme &g)
Definition ButtonTheme.h:66
void setButtonRadius(float r)
Definition ButtonTheme.h:88
float getBorderThickness() const
Definition ButtonTheme.h:79
sf::Color borderColor
Definition ButtonTheme.h:33
void setOffColor(const sf::Color &c)
Definition ButtonTheme.h:83
sf::Color getOnTextColor() const
Definition ButtonTheme.h:76
float getButtonRadius() const
Definition ButtonTheme.h:80
sf::Color offColor
Definition ButtonTheme.h:30
sf::Color getBorderColor() const
Definition ButtonTheme.h:78
void setBorderColor(const sf::Color &c)
Definition ButtonTheme.h:86
Theme tokens for interactive UI controls.
Theme tokens for all visual components.
Universal design token set applied across all Themeable components.
Definition Theme.h:70
sf::Color border
Definition Theme.h:98
sf::Color onPrimary
Definition Theme.h:89
float borderThickness
Definition Theme.h:138
sf::Color primary
Definition Theme.h:74
sf::Color onSurface
Definition Theme.h:86
float radius
Definition Theme.h:132
sf::Color surface
Definition Theme.h:80
Theme tokens shared by all toggle variants.
Definition ToggleTheme.h:31
ToggleTheme & applyFrom(const Theme &t) override
Populate all fields from the global Theme token set.
Definition ToggleTheme.h:38