|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Opens and closes a floating action button menu (speed dial): a trigger button that reveals a column of action buttons above it. More...
#include <headers/guillaume/systems/floating_action_button_menu.hpp>


Public Member Functions | |
| FloatingActionButtonMenu (void) | |
| Create the system for the Layout phase, matching entities that have a components::FloatingActionButtonMenu. | |
| ~FloatingActionButtonMenu (void) override=default | |
| Default destructor. | |
| void | update (const ecs::Entity::Identifier &entityIdentifier) override |
| Frame entry point: call apply on one menu. | |
| Public Member Functions inherited from guillaume::ecs::SystemFiller< components::FloatingActionButtonMenu > | |
| 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 an entity behave as a floating action button menu. | |
| static void | apply (ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier) |
| Bring the buttons in line with the open flag of the component, then lay out the column. | |
| static void | open (ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier) |
| Open the menu: show its actions at once, then call the state-change callback with true. | |
| static void | close (ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier) |
| Close the menu: hide its actions at once, then call the state-change callback with false. | |
| static void | toggle (ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier) |
| Open the menu when it is closed, close it when it is open, and call the state-change callback with the new state. | |
Static Public Attributes | |
| static constexpr const char * | CloseGlyph = "close" |
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. | |
Opens and closes a floating action button menu (speed dial): a trigger button that reveals a column of action buttons above it.
The menu entity is a vertical layout container. Its children are buttons built by the widget class (entities::FloatingActionButtonMenu) and recorded by identifier in components::FloatingActionButtonMenu: one trigger and one button per action.
The list of children in the menu's components::Layout is overwritten each frame: add or remove actions through the component (and call install again), not through the layout.
Definition at line 66 of file floating_action_button_menu.hpp.
| guillaume::systems::FloatingActionButtonMenu::FloatingActionButtonMenu | ( | void | ) |
Create the system for the Layout phase, matching entities that have a components::FloatingActionButtonMenu.
Definition at line 51 of file floating_action_button_menu.cpp.


|
static |
Bring the buttons in line with the open flag of the component, then lay out the column.
Each action button is made visible and focusable when the menu is open, hidden and not focusable when it is closed, and restyled when its visibility changed. The trigger shows CloseGlyph while open and the configured icon otherwise, and reports its expanded state to accessibility. The layout children become the open actions followed by the trigger, and systems::Layout::apply places them at once.
The frame calls it through update; open, close and toggle call it on a change. Call it yourself after writing components::FloatingActionButtonMenu::setOpen directly, which changes the flag without calling the state-change callback.
| componentRegistry | The registry holding the components. |
| entityIdentifier | The menu entity. |
Definition at line 147 of file floating_action_button_menu.cpp.


|
static |
Close the menu: hide its actions at once, then call the state-change callback with false.
Does nothing, and calls nothing, when the menu is already closed. Clicking an action does not close the menu by itself; call this from the action's handler when that is wanted.
| componentRegistry | The registry holding the components. |
| entityIdentifier | The menu entity. |
Definition at line 129 of file floating_action_button_menu.cpp.

|
static |
Make an entity behave as a floating action button menu.
Does three things:
Call it once the trigger and the action buttons exist and are recorded in the component, and again whenever the actions or their buttons change. A child identifier that is invalid or has no components::Button is skipped. It does not show or hide anything: apply does.
| componentRegistry | The registry holding the components. The trigger handler keeps its address, so it must outlive the menu. |
| entityIdentifier | The menu entity. It must have a components::FloatingActionButtonMenu and a components::Layout. |
Definition at line 57 of file floating_action_button_menu.cpp.

|
static |
Open the menu: show its actions at once, then call the state-change callback with true.
Does nothing, and calls nothing, when the menu is already open.
| componentRegistry | The registry holding the components. |
| entityIdentifier | The menu entity. |
Definition at line 122 of file floating_action_button_menu.cpp.

|
static |
Open the menu when it is closed, close it when it is open, and call the state-change callback with the new state.
This is what a click on the trigger does.
| componentRegistry | The registry holding the components. |
| entityIdentifier | The menu entity. |
Definition at line 136 of file floating_action_button_menu.cpp.


|
overridevirtual |
Frame entry point: call apply on one menu.
| entityIdentifier | The menu entity. An entity without a components::FloatingActionButtonMenu is logged and skipped. |
Implements guillaume::ecs::System.
Definition at line 207 of file floating_action_button_menu.cpp.

|
staticconstexpr |
Name of the glyph the trigger shows while the menu is open, in place of the icon configured in the component.
Definition at line 72 of file floating_action_button_menu.hpp.