|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Styles one destination of a navigation drawer and places its icon, label and trailing text. More...
#include <headers/guillaume/systems/navigation_drawer_destination.hpp>


Public Member Functions | |
| NavigationDrawerDestination (void) | |
| Create the system in the Layout phase. | |
| ~NavigationDrawerDestination (void) override=default | |
| Default destructor. | |
| void | update (const ecs::Entity::Identifier &entityIdentifier) override |
| Run apply() on one destination; called by the frame loop. | |
| Public Member Functions inherited from guillaume::ecs::SystemFiller< components::NavigationDrawerDestination > | |
| SystemFiller (Phase phase) | |
| Create the system and set its signature from ComponentTypes. | |
| virtual | ~SystemFiller (void)=default |
| Virtual destructor. | |
| Public Member Functions inherited from guillaume::ecs::System | |
| System (Phase phase) | |
| Create a system that runs in a given phase, with an empty signature. | |
| virtual | ~System (void)=default |
| Virtual destructor. | |
| Phase | getPhase (void) const noexcept |
| Get the phase of the frame in which the system runs. | |
| Entity::Signature | getSignature (void) const noexcept |
| Get the component types an entity must declare to be visited by this system. | |
| void | routine (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry, const ecs::EntityTreeTraveler &traveler) |
| Run the system once over a scene: prepare(), update() on each matching entity, cleanup(). | |
| void | bindComponentRegistry (ecs::ComponentRegistry &componentRegistry) |
| Bind a component registry so update() can be called directly, without routine(). | |
| void | unbindComponentRegistry (void) |
| Drop the binding made by bindComponentRegistry(). | |
| virtual void | prepare (void) |
| Called once per pass, before the first update(). | |
| virtual void | cleanup (void) |
| Called once per pass, after the last update(). | |
Static Public Member Functions | |
| static void | install (ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier) |
| Make a destination pressable. | |
| static void | apply (ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier) |
| Style one destination from its selection, enabled and interaction state, then arrange it. | |
| static void | arrange (ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier) |
| Place the children of one destination without restyling it. | |
| static void | press (ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier) |
| Activate the destination as a press on it would. | |
| static void | setDisabled (ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier, bool disabled) |
| Enable or disable the destination and restyle it. | |
| static bool | isDisabled (const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier) |
| Whether the destination ignores input. | |
| static bool | isSelected (const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier) |
| Whether the destination is the selected one. | |
Additional Inherited Members | |
| Protected Member Functions inherited from guillaume::ecs::System | |
| template<InheritFromComponent... ComponentTypes> | |
| void | setSignature (void) |
| Replace the signature by the one made of the given component types. | |
| ecs::EntityRegistry & | getEntityRegistry (void) |
| Get the entity registry of the scene being processed. | |
| const ecs::EntityRegistry & | getEntityRegistry (void) const |
| Get the entity registry of the scene being processed, read-only. | |
| ecs::ComponentRegistry & | getComponentRegistry (void) |
| Get the component registry of the scene being processed. | |
| const ecs::ComponentRegistry & | getComponentRegistry (void) const |
| Get the component registry of the scene being processed, read-only. | |
| template<InheritFromComponent ComponentType> | |
| bool | hasComponent (const ecs::Entity::Identifier &entityIdentifier) const |
| Tell whether an entity has a component, in the bound registry. | |
| template<InheritFromComponent ComponentType> | |
| ComponentType & | getComponent (const ecs::Entity::Identifier &entityIdentifier) |
| Get a component of an entity from the bound registry, to read or modify it. | |
| template<InheritFromComponent ComponentType> | |
| const ComponentType & | getComponent (const ecs::Entity::Identifier &entityIdentifier) const |
| Get a component of an entity from the bound registry, read-only. | |
| template<InheritFromComponent ComponentType> | |
| bool | requireComponent (const ecs::Entity::Identifier &entityIdentifier) |
| Tell whether an entity has a component, and log a warning naming the entity and the component when it does not. | |
Styles one destination of a navigation drawer and places its icon, label and trailing text.
Runs in the Layout phase on every entity that has a components::NavigationDrawerDestination. It is registered before systems::NavigationDrawer: the destination is styled on its own first, then the drawer that owns it gives it its final size and position.
A destination has two shapes, chosen by the collapsed flag of its component:
This system does not change the selection: a press only calls the press callback of the component. systems::NavigationDrawer::install replaces that callback with its own, which selects the destination.
Definition at line 67 of file navigation_drawer_destination.hpp.
| guillaume::systems::NavigationDrawerDestination::NavigationDrawerDestination | ( | void | ) |
Create the system in the Layout phase.
Definition at line 85 of file navigation_drawer_destination.cpp.


|
static |
Style one destination from its selection, enabled and interaction state, then arrange it.
This is what update() runs each frame. systems::NavigationDrawer calls it after sizing the destination, and the interaction components call it when the pointer enters, leaves or presses the destination.
The active pill is filled only for a selected, enabled destination, and carries the hover or press state layer. A disabled destination draws its icon and texts with the disabled content color. The disabled flag of the component is copied to the enabled flag of components::StyleState on every call, so set it with setDisabled() rather than on the style state. Ends with arrange().
| componentRegistry | The registry holding the components. |
| entityIdentifier | The destination entity. |
| ecs::EntityComponentNotFoundException | When the entity lacks components::NavigationDrawerDestination, Layout, Borders or Color. |
Definition at line 162 of file navigation_drawer_destination.cpp.


|
static |
Place the children of one destination without restyling it.
The layout children are, in order, the lead group, the label when the destination is collapsed (otherwise the label is inside the lead group) and the trailing text, skipping the ones that do not exist. The content of the lead group is then placed inside it. systems::NavigationDrawer calls it after moving the destination, so the children follow.
| componentRegistry | The registry holding the components. |
| entityIdentifier | The destination entity. |
Definition at line 245 of file navigation_drawer_destination.cpp.


|
static |
Make a destination pressable.
Adds the interaction components (hover and press state, focus, the Button accessibility role) and wires an activation to press() and a hover or press change to apply(). Call it once, after the entity has its components::NavigationDrawerDestination, Layout, Transform, Bound, Color, Borders and Selectable.
| componentRegistry | The registry holding the components. It is captured by the handlers and must outlive the entity. |
| entityIdentifier | The destination entity. |
Definition at line 91 of file navigation_drawer_destination.cpp.

|
static |
Whether the destination ignores input.
| componentRegistry | The registry holding the components. |
| entityIdentifier | The destination entity. |
Definition at line 120 of file navigation_drawer_destination.cpp.


|
static |
Whether the destination is the selected one.
| componentRegistry | The registry holding the components. |
| entityIdentifier | The destination entity. May be ecs::Entity::InvalidIdentifier. |
Definition at line 109 of file navigation_drawer_destination.cpp.


|
static |
Activate the destination as a press on it would.
Calls the press callback of components::NavigationDrawerDestination when there is one. Does nothing when the destination is disabled. The selection is not changed here; see the class description.
| componentRegistry | The registry holding the components. |
| entityIdentifier | The destination entity. |
Definition at line 142 of file navigation_drawer_destination.cpp.


|
static |
Enable or disable the destination and restyle it.
| componentRegistry | The registry holding the components. |
| entityIdentifier | The destination entity. |
| disabled | True to make the destination ignore presses and draw it dimmed, false to enable it. |
Definition at line 131 of file navigation_drawer_destination.cpp.


|
overridevirtual |
Run apply() on one destination; called by the frame loop.
Logs a warning and does nothing when the entity has no components::NavigationDrawerDestination.
| entityIdentifier | The destination entity. |
Implements guillaume::ecs::System.
Definition at line 279 of file navigation_drawer_destination.cpp.
