27#include "guillaume/entities/extended_floating_action_button.hpp"
28#include "guillaume/entities/builder_base.hpp"
30#include "guillaume/components/elevation.hpp"
32#include "guillaume/theme.hpp"
33#include "guillaume/systems/extended_floating_action_button.hpp"
46 std::shared_ptr<ExtendedFloatingActionButton>
51 _labelContent, _variant, _size, _lowered, _isDisabled,
52 _accessibilityLabel, _onClick);
58 _iconGlyphName.clear();
59 _iconStyle = components::Glyph::Style::Outlined;
60 _labelContent.clear();
61 _variant = Variant::Primary;
65 _accessibilityLabel.clear();
71 const std::string &iconGlyphName)
73 _iconGlyphName = iconGlyphName;
81 _iconStyle = iconStyle;
87 const std::string &labelContent)
89 _labelContent = labelContent;
95 std::function<
void(
void)> onClick)
97 _onClick = std::move(onClick);
133 const std::string &accessibilityLabel)
135 _accessibilityLabel = accessibilityLabel;
139 std::shared_ptr<ExtendedFloatingActionButton>
141 std::shared_ptr<Entity> parent,
const std::string &labelContent,
142 std::function<
void(
void)> onClick)
145 .withOnClick(onClick)
146 .registerEntity(parent);
149 ExtendedFloatingActionButton::ExtendedFloatingActionButton(
152 const std::string &labelContent,
Variant variant,
Size size,
153 bool lowered,
bool isDisabled,
const std::string &accessibilityLabel,
154 std::function<
void(
void)> onClick)
155 :
ButtonBase(registry, iconGlyphName, iconStyle, labelContent, false,
178 utility::graphic::Color32Bit
199 if (size.has_value() && *size <= 0.0f) {
200 throw std::invalid_argument(
"FAB custom size must be positive");
Style
Family of the Material Symbols font the icon belongs to.
Stores every component of a scene, per component type and per entity identifier, and knows which ones...
ComponentType & getComponent(const Entity::Identifier &entityIdentifier)
Get a component of an entity, to read or modify it.
ComponentType & addComponent(const Entity::Identifier &entityIdentifier, Args &&...args)
Construct a component for an entity, replacing the one it already has, if any.
ComponentRegistry & getComponentRegistry(void)
Get the registry in which the builder creates components.
Owns entities and gives the systems the list of entities to visit.
Entity::Signature getSignature(void) const noexcept
Get the set of component types the entity declares.
static Signature getSignatureFromTypes(void)
Build the signature that has exactly the bits of the given component types.
Entity::Identifier getIdentifier(void) const noexcept
Get the identifier of the entity.
void setSignature(void)
Replace the signature by the one made of the given component types.
guillaume::ecs::ParentEntityFiller< components::Transform, components::Bound, components::Color, components::Borders, components::Focus, components::HandButtonInteraction, components::HandHoverInteraction, components::MouseHoverInteraction, components::MouseButtonInteraction, components::StyleState, components::Accessibility, components::Button >::getComponentRegistry ComponentRegistry & getComponentRegistry(void)
EntityBuilderBase(ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
Makes the floating action button style tables reachable as guillaume::entities::fab_style.
Makes the color helpers callable from guillaume::entities without qualification.
Widgets: the classes used to create entities with the right components and children.