26#include "guillaume/entities/button_base.hpp"
28#include "guillaume/systems/layout.hpp"
29#include "guillaume/theme.hpp"
34 const std::string &iconGlyphName,
36 const std::string &labelContent,
bool isToggle,
37 bool isMorph,
bool isDisabled,
bool isTrailingIcon,
38 const std::string &accessibilityLabel,
39 std::function<
void(
void)> onClick)
63 .
setLabel(accessibilityLabel.empty() ? labelContent
64 : accessibilityLabel);
134 const std::string &selectedIconGlyphName)
176 .setLabel(accessibilityLabel);
192 .setHint(accessibilityHint);
213 const utility::graphic::PositionF &position,
214 const utility::graphic::OrientationF &orientation,
215 const std::uint32_t &layer)
220 utility::graphic::Color32Bit
227 utility::graphic::Color32Bit
229 const utility::graphic::Color32Bit &overlay,
240 scheme.getColor(SchemeColorRole::OnSurface).getColor(),
249 scheme.getColor(SchemeColorRole::OnSurface).getColor(),
258 scheme.getColor(SchemeColorRole::OnSurface).getColor(),
292 .setFocusable(visible);
303 std::optional<utility::graphic::Color32Bit> color)
311 std::optional<utility::graphic::Color32Bit> color)
319 const utility::graphic::Color32Bit &color)
const
325 const utility::graphic::Color32Bit &color)
const
387 const auto icon = iconBuilder.
makeIcon(
388 shared_from_this(),
state().getIconGlyphName(),
390 state().getIconStyle());
391 if (icon !=
nullptr) {
398 const auto label = labelBuilder.
makeText(
399 shared_from_this(),
state().getLabelContent(),
401 if (label !=
nullptr) {
What an entity means to a user who does not see it: its name, its role, its state and its place in th...
Accessibility & setLabel(const std::string &label)
Set the name announced for the entity, such as "Close".
Style
Family of the Material Symbols font the icon belongs to.
The interaction state of an entity in one place: enabled or disabled, and whether it is hovered,...
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.
Entity::Identifier getIdentifier(void) const noexcept
Get the identifier of the entity.
std::size_t Identifier
The key under which an entity's components are stored. Systems and components refer to entities by th...
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 >::ParentEntityFiller ParentEntityFiller(ComponentRegistry &componentRegistry)
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)
Configures Icon widgets and registers them in the scene's entity registry.
std::shared_ptr< Icon > makeIcon(std::shared_ptr< Entity > parent, const std::string &iconName, const float &fontSize, const utility::graphic::Color32Bit &color, const components::Glyph::Style &style)
Build an icon, register it under parent and reset the builder.
Configures Text widgets and registers them in the scene's entity registry.
std::shared_ptr< Text > makeText(std::shared_ptr< Entity > parent, const std::string &content, const float &fontSize, const utility::graphic::Color32Bit &color)
Build a text with an explicit font size, register it under parent and reset the builder.
static const utility::graphic::PoseF contentLayerPose(const utility::graphic::PositionF &position, const utility::graphic::OrientationF &orientation, const std::uint32_t &containerLayer)
Compute the pose of content placed by hand on a container.
Makes the color helpers callable from guillaume::entities without qualification.
State. Every class here is plain data attached to an entity.
AccessibilityRole
What an entity is for a screen reader or another assistive technology. The values mirror react-native...
@ Button
Pressable button.
The entity-component-system core, independent of any widget.
Widgets: the classes used to create entities with the right components and children.
utility::graphic::Color32Bit stateLayer(const utility::graphic::Color32Bit &base, const utility::graphic::Color32Bit &overlay, std::uint8_t alpha)
Blend a translucent tint over a base color.
utility::graphic::Color32Bit withAlpha(const utility::graphic::Color32Bit &color, std::uint8_t alpha)
Copy a color with another alpha channel.
bool isEnabled(const ecs::ComponentRegistry ®istry, const ecs::Entity::Identifier &entityIdentifier)
Whether an entity accepts input.
void setEnabled(ecs::ComponentRegistry ®istry, const ecs::Entity::Identifier &entityIdentifier, bool enabled)
Enable or disable an entity.
@ LabelLarge
14 / 20, medium weight.
@ DisabledContainer
0.12 opacity of onSurface containers.
@ DisabledContent
0.38 opacity of onSurface content.
std::uint8_t getStateLayerAlpha(theme::StateLayer layer)
Get the opacity the active theme gives to a state layer, as an alpha channel value.
const Scheme & getActiveScheme(void)
Get the color scheme in use: the scheme of the active theme selected by setActiveScheme().