|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Configures a NavigationBar, creates it and registers it in an entity registry. More...
#include <headers/guillaume/entities/navigation_bar.hpp>


Public Member Functions | |
| Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Create a builder set to the defaults of reset(). | |
| std::shared_ptr< NavigationBar > | buildEntity (void) override |
| Build a navigation bar and its destinations from the current configuration, without registering it or setting its parent. | |
| void | reset (void) override |
| Restore the defaults. | |
| Builder & | withPose (const utility::graphic::PoseF &pose) |
| Set where the bar is placed. | |
| Builder & | withVariant (Variant variant) |
| Set the variant. | |
| Builder & | addDestination (const std::string &iconGlyph, const std::string &label, const std::string &focusedIconGlyph="", const std::string &badge="") |
| Append a destination after the ones already added. | |
| Builder & | withOnIndexChange (std::function< void(std::size_t)> onIndexChange) |
| Set the handler called when the user selects another destination (Paper onIndexChange). | |
| std::shared_ptr< NavigationBar > | makeNavigationBar (std::shared_ptr< ecs::Entity > parent, Variant variant, const std::vector< std::pair< std::string, std::string > > &destinations) |
| Build a navigation bar, register it under parent and reset the builder. | |
| Public Member Functions inherited from guillaume::entities::EntityBuilderBase< NavigationBar > | |
| EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder bound to two registries. | |
| ~EntityBuilderBase (void) override=default | |
| Default destructor. | |
| std::shared_ptr< NavigationBar > | registerEntity (std::shared_ptr< ecs::Entity > parent) |
| Build the widget, attach it to its parent, hand it to the entity registry, then reset the builder to its defaults. | |
| Public Member Functions inherited from guillaume::ecs::EntityBuilder | |
| EntityBuilder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Create a builder working on a pair of registries, normally those of one scene. | |
| virtual | ~EntityBuilder (void)=default |
| Virtual destructor. | |
Additional Inherited Members | |
| Protected Member Functions inherited from guillaume::ecs::EntityBuilder | |
| ComponentRegistry & | getComponentRegistry (void) |
| Get the registry in which the builder creates components. | |
| EntityRegistry & | getEntityRegistry (void) |
| Get the registry in which the builder registers the entities it creates. | |
Configures a NavigationBar, creates it and registers it in an entity registry.
Definition at line 111 of file navigation_bar.hpp.
| guillaume::entities::NavigationBar::Builder::Builder | ( | ecs::ComponentRegistry & | componentRegistry, |
| ecs::EntityRegistry & | entityRegistry ) |
Create a builder set to the defaults of reset().
| componentRegistry | The registry that stores the components of the bars built. |
| entityRegistry | The registry the bars are added to. |
Definition at line 89 of file navigation_bar.cpp.

| NavigationBar::Builder & guillaume::entities::NavigationBar::Builder::addDestination | ( | const std::string & | iconGlyph, |
| const std::string & | label, | ||
| const std::string & | focusedIconGlyph = "", | ||
| const std::string & | badge = "" ) |
Append a destination after the ones already added.
| iconGlyph | The glyph name of the icon, such as "home". |
| label | The text shown under the icon. |
| focusedIconGlyph | The glyph name of the icon shown while the destination is selected; empty to keep iconGlyph. |
| badge | The badge label; empty for no badge. |
Definition at line 136 of file navigation_bar.cpp.
|
overridevirtual |
Build a navigation bar and its destinations from the current configuration, without registering it or setting its parent.
Implements guillaume::entities::EntityBuilderBase< NavigationBar >.
Definition at line 96 of file navigation_bar.cpp.

| std::shared_ptr< NavigationBar > guillaume::entities::NavigationBar::Builder::makeNavigationBar | ( | std::shared_ptr< ecs::Entity > | parent, |
| Variant | variant, | ||
| const std::vector< std::pair< std::string, std::string > > & | destinations ) |
Build a navigation bar, register it under parent and reset the builder.
The destinations given here come after the ones already added with addDestination().
| parent | The entity the bar becomes a child of, or nullptr for a root entity. |
| variant | The variant of the bar. |
| destinations | The (icon glyph name, label) pair of each destination to append, in display order. |
Definition at line 153 of file navigation_bar.cpp.

|
overridevirtual |
Restore the defaults.
Defaults: WithLabels variant, no destination, no index-change handler, default pose, 360 dp wide, 80 dp high (components::NavigationBar::Height), 8 dp of padding.
Implements guillaume::ecs::EntityBuilder.
Definition at line 104 of file navigation_bar.cpp.


| NavigationBar::Builder & guillaume::entities::NavigationBar::Builder::withOnIndexChange | ( | std::function< void(std::size_t)> | onIndexChange | ) |
Set the handler called when the user selects another destination (Paper onIndexChange).
| onIndexChange | Called with the index of the newly selected destination. Not called by select(). Default: none. |
Definition at line 146 of file navigation_bar.cpp.
| NavigationBar::Builder & guillaume::entities::NavigationBar::Builder::withPose | ( | const utility::graphic::PoseF & | pose | ) |
Set where the bar is placed.
| pose | The pose of the bar. Default: a default-constructed pose. |
Definition at line 124 of file navigation_bar.cpp.
| NavigationBar::Builder & guillaume::entities::NavigationBar::Builder::withVariant | ( | Variant | variant | ) |
Set the variant.
| variant | WithLabels (the default) to show every label, WithoutLabels to show only the label of the selected destination. |
Definition at line 130 of file navigation_bar.cpp.
