|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Configures, creates and registers FloatingActionButton widgets. More...
#include <headers/guillaume/entities/floating_action_button.hpp>


Public Member Functions | |
| Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder with the default configuration (see reset()). | |
| std::shared_ptr< FloatingActionButton > | buildEntity (void) override |
| Build a FloatingActionButton, with its icon and label children, from the current configuration, without registering it. | |
| void | reset (void) override |
| Restore the default configuration. | |
| Builder & | withIcon (const std::string &iconGlyphName) |
| Set the icon. | |
| Builder & | withIconStyle (const components::Glyph::Style &iconStyle) |
| Set the glyph style of the icon. | |
| Builder & | withLabel (const std::string &labelContent) |
| Set the label text, shown after the icon. | |
| Builder & | withOnClick (std::function< void(void)> onClick) |
| Set the click handler. | |
| Builder & | withVariant (const Variant &variant) |
| Set the color variant. | |
| Builder & | withSize (const Size &size) |
| Set the size. | |
| Builder & | withLowered (const bool &lowered) |
| Choose the lowered style: a weaker shadow (elevation level 1 instead of 3) and, for Variant::Surface, the matching level 1 surface color. | |
| Builder & | withDisabled (const bool &isDisabled) |
| Choose whether the FAB starts disabled. | |
| Builder & | withAccessibilityLabel (const std::string &accessibilityLabel) |
| Set the label read by assistive technology. | |
| std::shared_ptr< FloatingActionButton > | makeFloatingActionButton (std::shared_ptr< Entity > parent, const std::string &iconGlyphName, std::function< void(void)> onClick, Variant variant, Size size) |
| Build a FAB, register it under parent and reset the builder. | |
| Public Member Functions inherited from guillaume::entities::EntityBuilderBase< FloatingActionButton > | |
| EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder bound to two registries. | |
| ~EntityBuilderBase (void) override=default | |
| Default destructor. | |
| std::shared_ptr< FloatingActionButton > | 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, creates and registers FloatingActionButton widgets.
Set options with the with... methods then call registerEntity(), or use makeFloatingActionButton() to do both in one call.
Definition at line 101 of file floating_action_button.hpp.
| guillaume::entities::FloatingActionButton::Builder::Builder | ( | ecs::ComponentRegistry & | componentRegistry, |
| ecs::EntityRegistry & | entityRegistry ) |
Construct a builder with the default configuration (see reset()).
| componentRegistry | The registry that stores the components of the buttons to build. |
| entityRegistry | The registry the built buttons are added to (usually the scene's). |
Definition at line 38 of file floating_action_button.cpp.

|
overridevirtual |
Build a FloatingActionButton, with its icon and label children, from the current configuration, without registering it.
registerEntity() calls it, then sets the parent, registers the button and resets the builder.
Implements guillaume::entities::EntityBuilderBase< FloatingActionButton >.
Definition at line 48 of file floating_action_button.cpp.

| std::shared_ptr< FloatingActionButton > guillaume::entities::FloatingActionButton::Builder::makeFloatingActionButton | ( | std::shared_ptr< Entity > | parent, |
| const std::string & | iconGlyphName, | ||
| std::function< void(void)> | onClick, | ||
| Variant | variant, | ||
| Size | size ) |
Build a FAB, register it under parent and reset the builder.
Options set before the call with the other with... methods (lowered, accessibility label, ...) also apply.
| parent | The entity the FAB becomes a child of. |
| iconGlyphName | The glyph name of the icon. |
| onClick | The function called when the user clicks the FAB (may be empty). |
| variant | The color variant. |
| size | The size. |
Definition at line 135 of file floating_action_button.cpp.

|
overridevirtual |
Restore the default configuration.
Defaults: empty icon, Glyph::Style::Outlined, empty label, no click handler, Variant::Primary, Size::Medium, not lowered, enabled, empty accessibility label.
Implements guillaume::ecs::EntityBuilder.
Definition at line 57 of file floating_action_button.cpp.

| FloatingActionButton::Builder & guillaume::entities::FloatingActionButton::Builder::withAccessibilityLabel | ( | const std::string & | accessibilityLabel | ) |
Set the label read by assistive technology.
| accessibilityLabel | The accessibility label. Default: empty, in which case the label text is used. |
Definition at line 127 of file floating_action_button.cpp.
| FloatingActionButton::Builder & guillaume::entities::FloatingActionButton::Builder::withDisabled | ( | const bool & | isDisabled | ) |
Choose whether the FAB starts disabled.
| isDisabled | True for a FAB that ignores input. Default: false. |
Definition at line 120 of file floating_action_button.cpp.

| FloatingActionButton::Builder & guillaume::entities::FloatingActionButton::Builder::withIcon | ( | const std::string & | iconGlyphName | ) |
Set the icon.
| iconGlyphName | The glyph name of the icon (for example "add"). Default: empty. |
Definition at line 70 of file floating_action_button.cpp.

| FloatingActionButton::Builder & guillaume::entities::FloatingActionButton::Builder::withIconStyle | ( | const components::Glyph::Style & | iconStyle | ) |
Set the glyph style of the icon.
| iconStyle | The glyph style. Default: Glyph::Style::Outlined. |
Definition at line 77 of file floating_action_button.cpp.
| FloatingActionButton::Builder & guillaume::entities::FloatingActionButton::Builder::withLabel | ( | const std::string & | labelContent | ) |
Set the label text, shown after the icon.
| labelContent | The label text. Default: empty. It is also the accessibility label when none is set. |
Definition at line 84 of file floating_action_button.cpp.
| FloatingActionButton::Builder & guillaume::entities::FloatingActionButton::Builder::withLowered | ( | const bool & | lowered | ) |
Choose the lowered style: a weaker shadow (elevation level 1 instead of 3) and, for Variant::Surface, the matching level 1 surface color.
| lowered | True for the lowered style. Default: false. |
Definition at line 113 of file floating_action_button.cpp.
| FloatingActionButton::Builder & guillaume::entities::FloatingActionButton::Builder::withOnClick | ( | std::function< void(void)> | onClick | ) |
Set the click handler.
| onClick | The function called when the user clicks the FAB. Default: empty, nothing is called. |
Definition at line 91 of file floating_action_button.cpp.
| FloatingActionButton::Builder & guillaume::entities::FloatingActionButton::Builder::withSize | ( | const Size & | size | ) |
Set the size.
| size | The size. Default: Size::Medium. |
Definition at line 106 of file floating_action_button.cpp.
| FloatingActionButton::Builder & guillaume::entities::FloatingActionButton::Builder::withVariant | ( | const Variant & | variant | ) |
Set the color variant.
| variant | The color variant. Default: Variant::Primary. |
Definition at line 99 of file floating_action_button.cpp.