28#include "guillaume/ecs/component.hpp"
29#include "guillaume/theme/tokens.hpp"
176 bool _enabled {
true };
177 bool _hovered {
false };
178 bool _pressed {
false };
179 bool _focused {
false };
180 bool _dragged {
false };
187 void setFlag(
bool &flag,
bool value);
StyleState(void)=default
Construct an enabled, idle state.
bool isHovered(void) const
Check whether the mouse pointer or a hand ray is over the entity.
bool isDragged(void) const
Check whether a drag gesture is in progress on the entity.
~StyleState(void)=default
Default destructor.
bool isFocused(void) const
Check whether the entity owns the input focus.
StyleState & setFocused(bool focused)
Record whether the entity owns the input focus.
std::optional< theme::StateLayer > getActiveLayer(void) const
Get the Material 3 state layer to paint over the entity.
bool isEnabled(void) const
Check whether the entity accepts interaction.
StyleState & setEnabled(bool enabled)
Enable or disable the entity.
bool isPressed(void) const
Check whether the entity is pressed: the left mouse button or hand button A is held on it,...
StyleState & setPressed(bool pressed)
Record whether the entity is pressed.
StyleState & setDragged(bool dragged)
Record whether the entity is being dragged.
StyleState & setHovered(bool hovered)
Record whether the entity is hovered.
Base class of every component: a piece of state attached to an entity, plus a "changed" flag.
State. Every class here is plain data attached to an entity.