|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Styles one destination of a navigation bar (an icon in a pill with a label under it and an optional badge) and places those children. More...
#include <headers/guillaume/systems/navigation_bar_destination.hpp>


Public Member Functions | |
| NavigationBarDestination (void) | |
| Create the system in the Layout phase. | |
| ~NavigationBarDestination (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::NavigationBarDestination > | |
| 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 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 | setBadge (ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier, const std::string &badge) |
| Set the badge label and restyle the destination. | |
| 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 bar (an icon in a pill with a label under it and an optional badge) and places those children.
Runs in the Layout phase on every entity that has a components::NavigationBarDestination. It is registered before systems::NavigationBar: the destination is styled on its own first, then the bar that owns it gives it its final size and position and calls apply() and arrange() again.
This system does not change the selection: a press only calls the press callback of the component. systems::NavigationBar::install replaces that callback with its own, which selects the destination.
Definition at line 63 of file navigation_bar_destination.hpp.
| guillaume::systems::NavigationBarDestination::NavigationBarDestination | ( | void | ) |
Create the system in the Layout phase.
Definition at line 116 of file navigation_bar_destination.cpp.


|
static |
Style one destination from its selection and interaction state, then arrange it.
This is what update() runs each frame. systems::NavigationBar calls it after sizing the destination, and the interaction components call it when the pointer enters, leaves or presses the destination.
A selected destination has a filled indicator pill and shows its focused icon when it has one. The hover or press state layer is drawn on the pill. A label that is not shown is painted transparent and keeps its place in the column. The badge child, when it exists, shows the badge label, or a dot when the label is empty. Ends with arrange().
| componentRegistry | The registry holding the components. |
| entityIdentifier | The destination entity. |
| ecs::EntityComponentNotFoundException | When the entity lacks components::NavigationBarDestination, Layout, Color or Borders. |
Definition at line 178 of file navigation_bar_destination.cpp.


|
static |
Place the children of one destination without restyling it.
Stacks the indicator and the label in a column, places the icon inside the indicator, and puts the badge at the offset (components::NavigationBarDestination::BadgeOffsetX, BadgeOffsetY) from the origin of the indicator, over the corner of the icon. systems::NavigationBar 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_bar_destination.cpp.


|
static |
Make a destination pressable.
Adds the interaction components (hover and press state, focus, the Tab 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::NavigationBarDestination, 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 122 of file navigation_bar_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 139 of file navigation_bar_destination.cpp.


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


|
static |
Set the badge label and restyle the destination.
Only the content of an existing badge child changes: this does not create or remove the badge entity.
| componentRegistry | The registry holding the components. |
| entityIdentifier | The destination entity. |
| badge | The text shown in the badge, such as a count. An empty string shows a dot. |
Definition at line 166 of file navigation_bar_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::NavigationBarDestination.
| entityIdentifier | The destination entity. |
Implements guillaume::ecs::System.
Definition at line 287 of file navigation_bar_destination.cpp.
