28#include "guillaume/entities/button.hpp"
30#include "guillaume/components/elevation.hpp"
31#include "guillaume/entities/builder_base.hpp"
32#include "guillaume/theme.hpp"
33#include "guillaume/systems/common_button.hpp"
48 _labelContent, _isToggle, _colorStyle, _shape, _size, _isMorph,
49 _isDisabled, _isTrailingIcon, _accessibilityLabel, _onClick);
55 _iconGlyphName.clear();
56 _iconStyle = components::Glyph::Style::Outlined;
57 _labelContent.clear();
59 _colorStyle = Color::Text;
60 _shape = Shape::Round;
64 _isTrailingIcon =
false;
65 _accessibilityLabel.clear();
71 _iconGlyphName = iconGlyphName;
78 _iconStyle = iconStyle;
84 _labelContent = labelContent;
91 _onClick = std::move(onClick);
103 _colorStyle = colorStyle;
134 _isTrailingIcon = isTrailingIcon;
139 const std::string &accessibilityLabel)
141 _accessibilityLabel = accessibilityLabel;
146 std::shared_ptr<Entity> parent,
const std::string &labelContent,
147 std::function<
void(
void)> onClick,
Color colorStyle,
Shape shape,
148 Size size,
bool isMorph)
151 .withOnClick(onClick)
152 .withColorStyle(colorStyle)
156 .registerEntity(parent);
160 std::shared_ptr<Entity> parent,
const std::string &labelContent,
161 const std::string &iconGlyphName,
163 std::function<
void(
void)> onClick,
Color colorStyle,
Shape shape,
164 Size size,
bool isMorph)
167 .withIconStyle(iconStyle)
168 .withLabel(labelContent)
169 .withOnClick(onClick)
170 .withColorStyle(colorStyle)
174 .registerEntity(parent);
178 const std::string &iconGlyphName,
180 const std::string &labelContent,
bool isToggle,
183 const std::string &accessibilityLabel,
184 std::function<
void(
void)> onClick)
185 :
ButtonBase(registry, iconGlyphName, iconStyle, labelContent, isToggle,
186 isMorph,
isDisabled, isTrailingIcon, accessibilityLabel,
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)
Widgets: the classes used to create entities with the right components and children.