|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
A horizontal bar with a leading navigation icon button, a title and trailing action icon buttons. More...
#include <headers/guillaume/entities/app_bar.hpp>


Classes | |
| class | Builder |
| Configures an AppBar, creates it and registers it in an entity registry. More... | |
Public Types | |
| using | Variant = components::AppBar::Variant |
| using | Action = components::AppBar::Action |
| Public Types inherited from guillaume::entities::SurfaceBase< components::Elevation, components::AppBar > | |
| using | Children |
| Public Types inherited from guillaume::ecs::Entity | |
| using | Identifier = std::size_t |
| The key under which an entity's components are stored. Systems and components refer to entities by this value. | |
| using | Signature = std::bitset<128> |
| A set of component types, one bit per type (bit position given by ComponentTypeId, MaxComponentTypes bits). | |
Public Member Functions | |
| ~AppBar (void) override | |
| Default destructor. | |
| AppBar & | setVariant (Variant variant) |
| Change the variant. | |
| Variant | getVariant (void) const |
| Get the variant. | |
| AppBar & | setTitle (const std::string &title) |
| Change the title text. | |
| AppBar & | setElevated (bool elevated) |
| Choose the elevated look (Paper elevated). Restyles at once. | |
| bool | isElevated (void) const |
| Whether the app bar uses the elevated look. | |
| std::shared_ptr< IconButton > | getNavigationButton (void) const |
| Get the leading navigation button. | |
| std::shared_ptr< IconButton > | getActionButton (std::size_t index) const |
| Get a trailing action button. | |
| std::shared_ptr< Text > | getTitle (void) const |
| Get the title child. | |
| Public Member Functions inherited from guillaume::entities::SurfaceBase< components::Elevation, components::AppBar > | |
| ~SurfaceBase (void) override=default | |
| Default destructor. | |
| SurfaceBase & | setPose (const utility::graphic::PoseF &pose) |
| Move the surface. | |
| SurfaceBase & | setColor (const utility::graphic::Color32Bit &color) |
| Set the fill color (Color component). | |
| SurfaceBase & | setBorderRadius (float radius) |
| Set the radius of the four corners (Borders component). | |
| SurfaceBase & | setSurfaceConfig (const SurfaceConfig &config) |
| Apply every field of a configuration at once. | |
| SurfaceConfig | getSurfaceConfig (void) const |
| Read the current configuration back from the components. | |
| SurfaceBase & | setChildren (const Children &children) |
| Choose the children this surface arranges, in order. | |
| std::vector< ecs::Entity::Identifier > | getChildren (void) const |
| Get the children this surface arranges. | |
| Public Member Functions inherited from guillaume::ecs::ParentEntityFiller< components::Layout, components::Transform, components::Bound, components::Color, components::Borders, ExtraComponents... > | |
| ParentEntityFiller (ComponentRegistry &componentRegistry) | |
| Create the entity, its listed components and its components::Hierarchy. It owns no child yet. | |
| virtual | ~ParentEntityFiller (void)=default |
| Destroy the entity object and release the children it owns; components stay in the registry (see EntityRegistry::removeEntity). | |
| Public Member Functions inherited from guillaume::ecs::Entity | |
| Entity (void) | |
| Create an entity with a fresh identifier, an empty signature, no parent and no component. | |
| virtual | ~Entity (void)=default |
| Destroy the entity object. | |
| Entity::Identifier | getIdentifier (void) const noexcept |
| Get the identifier of the entity. | |
| Entity::Signature | getSignature (void) const noexcept |
| Get the set of component types the entity declares. | |
| void | setSignature (const Signature &signature) |
| Replace the signature of the entity. | |
| std::int32_t | getLayer (void) const noexcept |
| Get the depth of the entity in the tree. | |
| Entity & | setParent (std::shared_ptr< Entity > parent) |
| Attach the entity under another one, or detach it. | |
| std::vector< Identifier > | releaseComponents (void) |
| Drop the entity's place in the tree and all its components. | |
| std::shared_ptr< Entity > | getParent (void) const noexcept |
| Get the parent entity. | |
| Public Member Functions inherited from guillaume::ecs::EntityRegistry | |
| EntityRegistry (void)=default | |
| Create a registry. | |
| virtual | ~EntityRegistry (void)=default |
| Virtual destructor. | |
| void | addEntity (std::shared_ptr< Entity > entity) |
| Make this registry own an entity, so that it stays alive and systems visit it. | |
| bool | removeEntity (Entity::Identifier identifier) |
| Remove an entity, with its children and all their components. | |
| void | clearEntities (void) |
| Remove every entity owned by this registry, with everything they own and all their components. | |
| const std::vector< std::shared_ptr< Entity > > & | getEntities (void) const |
| Get the entities this registry owns directly. | |
| std::vector< std::shared_ptr< Entity > > | getEntitiesBreadthFirst (void) |
| List every entity of this registry and of the registries nested in it, level by level. | |
| std::vector< std::shared_ptr< Entity > > | getEntitiesBreadthFirst (void) const |
| List every entity of this registry and of the registries nested in it, level by level (const overload). | |
| template<InheritFromEntity EntityType> | |
| std::shared_ptr< EntityType > | getEntity (Entity::Identifier identifier) |
| Find an entity owned directly by this registry, by identifier. | |
| template<InheritFromEntity EntityType> | |
| std::shared_ptr< const EntityType > | getEntity (Entity::Identifier identifier) const |
| Find an entity owned directly by this registry, by identifier (const overload). | |
| std::vector< Entity::Identifier > | getEntityWithSignature (Entity::Signature systemSignature) const |
| List the entities that have every component type of a signature, from the root down. | |
| std::vector< Entity::Identifier > | getEntityWithSignature (Entity::Signature systemSignature, const EntityTreeTraveler &traveler) const |
| List the entities that have every component type of a signature, in the order chosen by a traveler. | |
Static Public Member Functions | |
| template<typename... Arguments> | |
| static std::shared_ptr< AppBar > | create (Arguments &&...arguments) |
| Create an app bar and its children, without registering it in an entity registry. | |
| Static Public Member Functions inherited from guillaume::ecs::Entity | |
| template<InheritFromComponent... ComponentTypes> | |
| static Signature | getSignatureFromTypes (void) |
| Build the signature that has exactly the bits of the given component types. | |
Static Public Attributes | |
| static constexpr float | HorizontalPadding |
| Padding around the children and spacing between them, in dp (Paper: 4 dp). | |
| Static Public Attributes inherited from guillaume::ecs::Entity | |
| static constexpr Identifier | InvalidIdentifier |
| "No entity": never the identifier of a real entity | |
Additional Inherited Members | |
| Protected Member Functions inherited from guillaume::entities::SurfaceBase< components::Elevation, components::AppBar > | |
| SurfaceBase (ecs::ComponentRegistry ®istry, const SurfaceConfig &config) | |
| Create the entity with its components and apply a configuration. | |
| void | applyGeometry (void) |
| Arrange the layout children now with systems::Layout::apply. | |
| Protected Member Functions inherited from guillaume::ecs::ParentEntityFiller< components::Layout, components::Transform, components::Bound, components::Color, components::Borders, ExtraComponents... > | |
| ComponentRegistry & | getComponentRegistry (void) |
| Get the registry that stores this entity's components. | |
| Protected Member Functions inherited from guillaume::ecs::ParentEntity | |
| std::vector< std::shared_ptr< Entity > > & | accessDirectEntities (void) override |
| Give access to the list of entities this entity owns directly. | |
| const std::vector< std::shared_ptr< Entity > > & | accessDirectEntities (void) const override |
| Give read access to the list of entities this entity owns directly. | |
| Protected Member Functions inherited from guillaume::ecs::Entity | |
| void | attachHierarchy (ComponentRegistry &componentRegistry) |
| Give the entity a components::Hierarchy in a registry and add that component to its signature. | |
| template<InheritFromComponent... ComponentTypes> | |
| void | setSignature (void) |
| Replace the signature by the one made of the given component types. | |
A horizontal bar with a leading navigation icon button, a title and trailing action icon buttons.
Its state lives in components::AppBar (variant, title, navigation action, trailing actions, elevated flag, child identifiers); systems::AppBar styles the bar and arranges its children each frame, in the Layout phase. The class itself holds no field: its setters write the component and restyle at once.
AppBar::create(registry, config, variant, title, navigation, actions, elevated) builds the same widget without registering it in an entity registry.
Things to know:
Definition at line 91 of file app_bar.hpp.
A pressable app bar icon (navigation or action): glyph name, press handler, accessible name and disabled flag.
Definition at line 100 of file app_bar.hpp.
Variant: it sets the height, the title typescale role and how the children are spread.
Definition at line 96 of file app_bar.hpp.
|
override |
Default destructor.
Definition at line 185 of file app_bar.cpp.
|
inlinestatic |
Create an app bar and its children, without registering it in an entity registry.
The constructors are private because the children need the app bar to be owned by a shared pointer before they can take it as parent; create() constructs the app bar, then builds the navigation button, the title and the action buttons.
| Arguments | The types of the constructor arguments. |
| arguments | Forwarded to a private constructor: either (registry, config, variant, title, navigation, actions, elevated) with Action values, or (registry, config, variant, title, navigationIcon, actions) with glyph names only (no press handler, not elevated). |
Definition at line 262 of file app_bar.hpp.

| std::shared_ptr< IconButton > guillaume::entities::AppBar::getActionButton | ( | std::size_t | index | ) | const |
Get a trailing action button.
| index | The position of the action, 0 being the first one added. |
Definition at line 295 of file app_bar.cpp.

| std::shared_ptr< IconButton > guillaume::entities::AppBar::getNavigationButton | ( | void | ) | const |
Get the leading navigation button.
Definition at line 285 of file app_bar.cpp.


| std::shared_ptr< Text > guillaume::entities::AppBar::getTitle | ( | void | ) | const |
Get the title child.
Definition at line 309 of file app_bar.cpp.

| AppBar::Variant guillaume::entities::AppBar::getVariant | ( | void | ) | const |
Get the variant.
Definition at line 317 of file app_bar.cpp.


| bool guillaume::entities::AppBar::isElevated | ( | void | ) | const |
Whether the app bar uses the elevated look.
Definition at line 278 of file app_bar.cpp.


| AppBar & guillaume::entities::AppBar::setElevated | ( | bool | elevated | ) |
Choose the elevated look (Paper elevated). Restyles at once.
| elevated | True for the level-2 elevation and its tinted surface color, false for a flat bar. |
Definition at line 269 of file app_bar.cpp.


| AppBar & guillaume::entities::AppBar::setTitle | ( | const std::string & | title | ) |
Change the title text.
Builds the title child when the app bar has none and title is not empty, then restyles at once. An empty title keeps an existing child, with an empty content.
| title | The new title. |
Definition at line 324 of file app_bar.cpp.


| AppBar & guillaume::entities::AppBar::setVariant | ( | Variant | variant | ) |
Change the variant.
Restyles at once: the height, the title typescale role and the main-axis alignment follow the variant.
| variant | The new variant. |
Definition at line 260 of file app_bar.cpp.


|
staticconstexpr |
Padding around the children and spacing between them, in dp (Paper: 4 dp).
Definition at line 343 of file app_bar.hpp.