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


Public Member Functions | |
| Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Create a builder set to the defaults of reset(). | |
| std::shared_ptr< NavigationDrawer > | buildEntity (void) override |
| Build a drawer and its children 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 drawer is placed. | |
| Builder & | withVariant (Variant variant) |
| Set the variant. | |
| Builder & | addDestination (const std::string &iconGlyph, const std::string &label, const std::string &right="", bool disabled=false) |
| Append a destination after the entries already added. | |
| Builder & | addSection (const std::string &title) |
| Append a section title after the entries already added. | |
| Builder & | addDivider (void) |
| Append a horizontal divider after the entries already added. | |
| Builder & | withOnIndexChange (std::function< void(std::size_t)> onIndexChange) |
| Set the handler called when the user selects another destination. | |
| std::shared_ptr< NavigationDrawer > | makeNavigationDrawer (std::shared_ptr< ecs::Entity > parent, Variant variant, const std::vector< std::pair< std::string, std::string > > &destinations) |
| Build a drawer, register it under parent and reset the builder. | |
| Public Member Functions inherited from guillaume::entities::EntityBuilderBase< NavigationDrawer > | |
| EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder bound to two registries. | |
| ~EntityBuilderBase (void) override=default | |
| Default destructor. | |
| std::shared_ptr< NavigationDrawer > | 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 NavigationDrawer, creates it and registers it in an entity registry.
Definition at line 125 of file navigation_drawer.hpp.
| guillaume::entities::NavigationDrawer::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 drawers built. |
| entityRegistry | The registry the drawers are added to. |
Definition at line 65 of file navigation_drawer.cpp.

| NavigationDrawer::Builder & guillaume::entities::NavigationDrawer::Builder::addDestination | ( | const std::string & | iconGlyph, |
| const std::string & | label, | ||
| const std::string & | right = "", | ||
| bool | disabled = false ) |
Append a destination after the entries already added.
| iconGlyph | The glyph name of the icon, such as "inbox"; empty for no icon. |
| label | The text of the destination. |
| right | A short text shown at the far edge of the row, such as a count; empty for none. Not shown by the Collapsed variant. |
| disabled | True to make the destination ignore presses. |
Definition at line 114 of file navigation_drawer.cpp.

| NavigationDrawer::Builder & guillaume::entities::NavigationDrawer::Builder::addDivider | ( | void | ) |
Append a horizontal divider after the entries already added.
Definition at line 138 of file navigation_drawer.cpp.
| NavigationDrawer::Builder & guillaume::entities::NavigationDrawer::Builder::addSection | ( | const std::string & | title | ) |
Append a section title after the entries already added.
| title | The title text. The Collapsed variant builds no child for it. |
Definition at line 129 of file navigation_drawer.cpp.
|
overridevirtual |
Build a drawer and its children from the current configuration, without registering it or setting its parent.
Implements guillaume::entities::EntityBuilderBase< NavigationDrawer >.
Definition at line 74 of file navigation_drawer.cpp.

| std::shared_ptr< NavigationDrawer > guillaume::entities::NavigationDrawer::Builder::makeNavigationDrawer | ( | std::shared_ptr< ecs::Entity > | parent, |
| Variant | variant, | ||
| const std::vector< std::pair< std::string, std::string > > & | destinations ) |
Build a drawer, register it under parent and reset the builder.
The destinations given here come after the entries already added with addDestination(), addSection() and addDivider().
| parent | The entity the drawer becomes a child of, or nullptr for a root entity. |
| variant | The variant of the drawer. |
| destinations | The (icon glyph name, label) pair of each destination to append; may be empty. |
Definition at line 154 of file navigation_drawer.cpp.

|
overridevirtual |
Restore the defaults.
Defaults: Standard variant, no entry, no index-change handler, default pose, 320 dp wide and 640 dp high (components::NavigationDrawer::Width and Height), 12 dp of padding and 4 dp between entries.
Implements guillaume::ecs::EntityBuilder.
Definition at line 82 of file navigation_drawer.cpp.

| NavigationDrawer::Builder & guillaume::entities::NavigationDrawer::Builder::withOnIndexChange | ( | std::function< void(std::size_t)> | onIndexChange | ) |
Set the handler called when the user selects another destination.
| onIndexChange | Called with the index of the newly selected destination (sections and dividers are not counted). Not called by select(). Default: none. |
Definition at line 146 of file navigation_drawer.cpp.
| NavigationDrawer::Builder & guillaume::entities::NavigationDrawer::Builder::withPose | ( | const utility::graphic::PoseF & | pose | ) |
Set where the drawer is placed.
| pose | The pose of the drawer. Default: a default-constructed pose. |
Definition at line 101 of file navigation_drawer.cpp.
| NavigationDrawer::Builder & guillaume::entities::NavigationDrawer::Builder::withVariant | ( | Variant | variant | ) |
Set the variant.
| variant | Standard (the default), Modal or Collapsed. |
Definition at line 108 of file navigation_drawer.cpp.
