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);
32 float dividerThickness = 1.f;
33
34 // ── applyFrom ─────────────────────────────────────────────────────────
35
36 ListItemTheme& applyFrom(const Theme& t) override
37 {
41 t.onSurface.g,
42 t.onSurface.b, 18);
45 // List items use tighter vertical padding than the global spacing
46 padding = 6.f;
47 return *this;
48 }
49
50 // ── Assignment from parent levels ─────────────────────────────────────
51
53 { static_cast<ControlTheme&>(*this) = c; return *this; }
54
56 { static_cast<ControlTheme&>(*this) = g; return *this; }
57
58 // ── Getters / setters ─────────────────────────────────────────────────
59
60 [[nodiscard]] sf::Color getBgIdle() const { return bgIdle; }
61 [[nodiscard]] sf::Color getBgHover() const { return bgHover; }
62 [[nodiscard]] sf::Color getBgDisabled() const { return bgDisabled; }
63 [[nodiscard]] sf::Color getDividerColor() const { return dividerColor; }
64 [[nodiscard]] float getDividerThickness() const { return dividerThickness; }
65
66 void setBgIdle(const sf::Color& c) { bgIdle = c; }
67 void setBgHover(const sf::Color& c) { bgHover = c; }
68 void setBgDisabled(const sf::Color& c) { bgDisabled = c; }
69 void setDividerColor(const sf::Color& c) { dividerColor = c; }
71 };
72
73} // namespace ml
74
75#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