28#include "guillaume/entities/floating_action_button.hpp"
29#include "guillaume/entities/builder_base.hpp"
31#include "guillaume/components/elevation.hpp"
33#include "guillaume/theme.hpp"
34#include "guillaume/systems/floating_action_button.hpp"
47 std::shared_ptr<FloatingActionButton>
52 _labelContent, _variant, _size, _lowered, _isDisabled,
53 _accessibilityLabel, _onClick);
59 _iconGlyphName.clear();
60 _iconStyle = components::Glyph::Style::Outlined;
61 _labelContent.clear();
62 _variant = Variant::Primary;
66 _accessibilityLabel.clear();
71 const std::string &iconGlyphName)
73 _iconGlyphName = iconGlyphName;
80 _iconStyle = iconStyle;
85 const std::string &labelContent)
87 _labelContent = labelContent;
92 std::function<
void(
void)> onClick)
94 _onClick = std::move(onClick);
128 const std::string &accessibilityLabel)
130 _accessibilityLabel = accessibilityLabel;
134 std::shared_ptr<FloatingActionButton>
136 std::shared_ptr<Entity> parent,
const std::string &iconGlyphName,
137 std::function<
void(
void)> onClick,
Variant variant,
Size size)
140 .withOnClick(onClick)
141 .withVariant(variant)
143 .registerEntity(parent);
146 FloatingActionButton::FloatingActionButton(
149 const std::string &labelContent,
Variant variant,
Size size,
150 bool lowered,
bool isDisabled,
const std::string &accessibilityLabel,
151 std::function<
void(
void)> onClick)
152 :
ButtonBase(registry, iconGlyphName, iconStyle, labelContent, false,
174 utility::graphic::Color32Bit
193 if (size.has_value() && *size <= 0.0f) {
194 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.