Loading...
Searching...
No Matches
ListItemTheme.h
Go to the documentation of this file.
1//
2// ListItemTheme.h
3//
4
5#ifndef MALENA_LISTITEMTHEME_H
6#define MALENA_LISTITEMTHEME_H
7
8#pragma once
9
12
13namespace ml
14{
27 {
29 sf::Color bgHover = sf::Color(255, 255, 255, 18);
30 sf::Color bgSelected = sf::Color(0, 122, 255, 70);
33 float dividerThickness = 1.f;
34
35 // ── applyFrom ─────────────────────────────────────────────────────────
36
37 ListItemTheme& applyFrom(const Theme& t) override
38 {
42 t.onSurface.g,
43 t.onSurface.b, 18);
46 // List items use tighter vertical padding than the global spacing
47 padding = 6.f;
48 return *this;
49 }
50
51 // ── Assignment from parent levels ─────────────────────────────────────
52
54 { static_cast<ControlTheme&>(*this) = c; return *this; }
55
57 { static_cast<ControlTheme&>(*this) = g; return *this; }
58
59 // ── Getters / setters ─────────────────────────────────────────────────
60
61 [[nodiscard]] sf::Color getBgIdle() const { return bgIdle; }
62 [[nodiscard]] sf::Color getBgHover() const { return bgHover; }
63 [[nodiscard]] sf::Color getBgDisabled() const { return bgDisabled; }
64 [[nodiscard]] sf::Color getDividerColor() const { return dividerColor; }
65 [[nodiscard]] float getDividerThickness() const { return dividerThickness; }
66
67 void setBgIdle(const sf::Color& c) { bgIdle = c; }
68 void setBgHover(const sf::Color& c) { bgHover = c; }
69 void setBgDisabled(const sf::Color& c) { bgDisabled = c; }
70 void setDividerColor(const sf::Color& c) { dividerColor = c; }
72 };
73
74} // namespace ml
75
76#endif // MALENA_LISTITEMTHEME_H
static const Color Transparent
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 for ListItem.
float getDividerThickness() const
ListItemTheme & operator=(const ControlTheme &c)
ListItemTheme & operator=(const GraphicTheme &g)
void setDividerColor(const sf::Color &c)
sf::Color getDividerColor() const
void setBgDisabled(const sf::Color &c)
void setBgHover(const sf::Color &c)
ListItemTheme & applyFrom(const Theme &t) override
Populate all fields from the global Theme token set.
void setBgIdle(const sf::Color &c)
sf::Color getBgHover() const
sf::Color dividerColor
void setDividerThickness(float t)
sf::Color getBgDisabled() const
sf::Color getBgIdle() const
Universal design token set applied across all Themeable components.
Definition Theme.h:70
sf::Color border
Definition Theme.h:98
sf::Color onSurface
Definition Theme.h:86