50 : _fg(
fg), _bg(
bg), _attrs(
attrs), _attrMask(0xFF) {}
105 bool operator==(
const TuiStyle &
o)
const {
106 return _fg ==
o._fg && _bg ==
o._bg &&
107 _attrs ==
o._attrs && _attrMask ==
o._attrMask;
109 bool operator!=(
const TuiStyle &
o)
const {
return !(*
this ==
o); }
128 bool focused()
const {
return _focused; }
129 bool enabled()
const {
return _enabled; }
130 bool pressed()
const {
return _pressed; }
131 bool selected()
const {
return _selected; }
133 void setFocused(
bool v) { _focused = v; }
134 void setEnabled(
bool v) { _enabled = v; }
135 void setPressed(
bool v) { _pressed = v; }
136 void setSelected(
bool v) { _selected = v; }
139 bool _focused =
false;
140 bool _enabled =
true;
141 bool _pressed =
false;
142 bool _selected =
false;
General-purpose RGBA color.
Definition color.h:24
bool isValid() const
Returns true if this color was explicitly constructed.
Definition color.h:34
Dynamic array container wrapping std::vector.
Definition list.h:40
Widget state bundle fed into palette lookups.
Definition style.h:124
Visual properties of a TUI cell (everything except the character).
Definition style.h:29
void setForeground(const Color &color)
Sets the foreground color.
Definition style.h:65
Color foreground() const
Returns the foreground color.
Definition style.h:53
bool hasForeground() const
Returns true if the foreground color is defined (not ignored).
Definition style.h:77
void setBackground(const Color &color)
Sets the background color.
Definition style.h:68
static TuiStyle fromForeground(const Color &fg, uint8_t attrs=None, uint8_t attrMask=0)
Creates a foreground-only style (background ignored).
Definition style.h:90
TuiStyle()=default
Default constructor. All properties are ignored.
bool hasBackground() const
Returns true if the background color is defined (not ignored).
Definition style.h:80
TuiStyle merged(const TuiStyle &below) const
Merges this style on top of another.
uint8_t attrMask() const
Returns the attribute mask (1 = defined, 0 = ignored).
Definition style.h:62
uint8_t attrs() const
Returns the attribute flags.
Definition style.h:59
void setAttrs(uint8_t attrs, uint8_t mask)
Sets attribute flags with an explicit mask.
Definition style.h:74
Color background() const
Returns the background color.
Definition style.h:56
TuiStyle(const Color &fg, const Color &bg, uint8_t attrs=None)
Constructs with foreground, background, and attributes (all defined).
Definition style.h:49
static TuiStyle fromBackground(const Color &bg)
Creates a background-only style (foreground ignored).
Definition style.h:99
Attr
Text attribute flags.
Definition style.h:34
void setAttrs(uint8_t attrs)
Sets all attribute flags (marks all bits as defined).
Definition style.h:71
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19