|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Look of a Material 3 extended floating action button: a FAB that shows a label next to its icon and can collapse to the icon alone. More...
#include <headers/guillaume/components/extended_floating_action_button.hpp>


Public Types | |
| enum class | Variant { Surface , Primary , Secondary , Tertiary } |
| Which theme colors fill the container, the icon and the label. More... | |
| enum class | Mode { Elevated , Flat } |
| Whether the button casts a shadow (Elevated) or not (Flat). More... | |
| enum class | Size { Small , Medium , Large } |
| Size step: a container 40, 56 or 96 dp high. More... | |
Public Member Functions | |
| ExtendedFloatingActionButton (void)=default | |
| Create the configuration of a medium, elevated, primary button with its label shown. | |
| ~ExtendedFloatingActionButton (void)=default | |
| Default destructor. | |
| Variant | getVariant (void) const noexcept |
| Get the color variant. | |
| ExtendedFloatingActionButton & | setVariant (Variant variant) |
| Choose which theme colors the button uses. | |
| Size | getSize (void) const noexcept |
| Get the size step. | |
| ExtendedFloatingActionButton & | setSize (Size size) |
| Choose the size step. | |
| Mode | getMode (void) const noexcept |
| Get the shadow mode. | |
| ExtendedFloatingActionButton & | setMode (Mode mode) |
| Choose whether the button casts a shadow. | |
| const std::optional< float > & | getCustomSize (void) const noexcept |
| Get the container height that replaces the one of the size step. | |
| ExtendedFloatingActionButton & | setCustomSize (const std::optional< float > &size) |
| Replace the container height of the size step. | |
| bool | isExtended (void) const noexcept |
| Check whether the label is shown. | |
| ExtendedFloatingActionButton & | setExtended (bool extended) |
| Show the label, or collapse the button to its icon. | |
| bool | isLowered (void) const noexcept |
| Check whether the resting shadow is lowered. | |
| ExtendedFloatingActionButton & | setLowered (bool lowered) |
| Lower the resting shadow, or restore it. | |
| Public Member Functions inherited from guillaume::ecs::Component | |
| bool | hasChanged (void) const |
| Tell whether a value of the component changed since the flags were last reset (the end of the previous frame). | |
| void | setHasChanged (bool hasChanged) |
| Raise or lower the changed flag. | |
| Component (void)=default | |
| Create a component that is not marked as changed. | |
| virtual | ~Component (void)=default |
| Virtual destructor, so components can be destroyed through the base class. | |
Look of a Material 3 extended floating action button: a FAB that shows a label next to its icon and can collapse to the icon alone.
It sits on the same entity as components::Button, which holds the glyph, the label text and the interaction state. entities::ExtendedFloatingActionButton writes it; systems::ExtendedFloatingActionButton reads both, each frame in the Layout phase and at once after every input change, and writes the button's Color, Elevation, Borders and Bound and places the icon and label children.
Hiding the button is done on components::Button (Button::setVisible(false)): the system then draws it transparent and without shadow.
Every setter compares before writing and marks the component changed only when the value differs.
Definition at line 56 of file extended_floating_action_button.hpp.
|
strong |
Whether the button casts a shadow (Elevated) or not (Flat).
Definition at line 72 of file extended_floating_action_button.hpp.
|
strong |
Size step: a container 40, 56 or 96 dp high.
Definition at line 77 of file extended_floating_action_button.hpp.
|
strong |
Which theme colors fill the container, the icon and the label.
Primary, Secondary and Tertiary use the matching container role. Surface uses the tonal surface color of the button's elevation with primary content.
Definition at line 67 of file extended_floating_action_button.hpp.
|
noexcept |
Get the container height that replaces the one of the size step.
Definition at line 78 of file extended_floating_action_button.cpp.
|
noexcept |
Get the shadow mode.
Definition at line 62 of file extended_floating_action_button.cpp.
|
noexcept |
Get the size step.
Definition at line 46 of file extended_floating_action_button.cpp.
|
noexcept |
Get the color variant.
Definition at line 30 of file extended_floating_action_button.cpp.
|
noexcept |
Check whether the label is shown.
Definition at line 93 of file extended_floating_action_button.cpp.
|
noexcept |
Check whether the resting shadow is lowered.
Definition at line 108 of file extended_floating_action_button.cpp.
| ExtendedFloatingActionButton & guillaume::components::ExtendedFloatingActionButton::setCustomSize | ( | const std::optional< float > & | size | ) |
Replace the container height of the size step.
It is also the width of the collapsed button. The corner radius follows: it is the custom size divided by 3.5.
| size | The height, in dp, or std::nullopt to follow the size step. |
Definition at line 83 of file extended_floating_action_button.cpp.

| ExtendedFloatingActionButton & guillaume::components::ExtendedFloatingActionButton::setExtended | ( | bool | extended | ) |
Show the label, or collapse the button to its icon.
Collapsed, the button is a square with the icon centered; the label child stays in the tree but is drawn transparent. An extended button whose label measures nothing is laid out as collapsed.
| extended | True to show the label. |
Definition at line 99 of file extended_floating_action_button.cpp.

| ExtendedFloatingActionButton & guillaume::components::ExtendedFloatingActionButton::setLowered | ( | bool | lowered | ) |
Lower the resting shadow, or restore it.
An elevated button rests at elevation level 3, or level 1 when lowered. The Surface variant takes the surface tone of the same level.
| lowered | True to rest at elevation level 1. |
Definition at line 114 of file extended_floating_action_button.cpp.

| ExtendedFloatingActionButton & guillaume::components::ExtendedFloatingActionButton::setMode | ( | Mode | mode | ) |
Choose whether the button casts a shadow.
| mode | Elevated for a shadow that rises one level on hover, Flat for no shadow at all. |
Definition at line 68 of file extended_floating_action_button.cpp.

| ExtendedFloatingActionButton & guillaume::components::ExtendedFloatingActionButton::setSize | ( | Size | size | ) |
Choose the size step.
| size | The size; it sets the container height, the corner radius and the icon font size (18, 24 or 36 dp). |
Definition at line 52 of file extended_floating_action_button.cpp.

| ExtendedFloatingActionButton & guillaume::components::ExtendedFloatingActionButton::setVariant | ( | Variant | variant | ) |
Choose which theme colors the button uses.
| variant | The color variant. |
Definition at line 36 of file extended_floating_action_button.cpp.
