25#include "guillaume/entities/icon.hpp"
26#include "guillaume/theme.hpp"
27#include "guillaume/entities/builder_base.hpp"
32 Icon::Icon::Builder::Builder(ecs::ComponentRegistry &componentRegistry,
33 ecs::EntityRegistry &entityRegistry)
42 _fontSize, _color, _style);
51 _style = components::Glyph::Style::Outlined;
56 _glyphName = glyphName;
81 std::shared_ptr<Entity> parent,
const std::string &glyphName,
82 const float &fontSize,
const utility::graphic::Color32Bit &color,
86 .withFontSize(fontSize)
89 .registerEntity(parent);
93 const float &fontSize,
const utility::graphic::Color32Bit &color,
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".
Main color of an entity: the fill of a shape, or the ink of a text or an icon.
An icon: one glyph of the Material Symbols font, chosen by name, at a given size.
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.
ComponentRegistry & getComponentRegistry(void)
Get the registry in which the builder creates components.
EntityFiller(ComponentRegistry &componentRegistry)
ComponentRegistry & getComponentRegistry(void)
Entity::Identifier getIdentifier(void) const noexcept
Get the identifier of the entity.
Base of every widget Builder: turns a configuration into a widget that is attached to a parent and ow...
Configures Icon widgets and registers them in the scene's entity registry.
Builder & withGlyphName(const std::string &glyphName)
Choose the icon to draw.
Builder & withFontSize(float fontSize)
Set the size of the icon.
Builder & withColor(const utility::graphic::Color32Bit &color)
Set the icon color.
Builder & withStyle(const components::Glyph::Style &style)
Set the Material Symbols style of the glyph.
void reset(void) override
Restore the defaults: empty glyph name, font size 24, the OnSurface color of the active theme,...
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.
std::shared_ptr< Icon > buildEntity(void) override
Build an icon from the current configuration, without registering it or giving it a parent.
A Material Symbols icon, chosen by name and drawn as one glyph of the icon font.
Icon & setAccessibilityLabel(const std::string &label)
Give the icon a meaning for assistive technologies.
Icon & setFontSize(const float &fontSize)
Set the size of the icon.
Icon & setStyle(const components::Glyph::Style &style)
Set the Material Symbols style of the glyph.
Icon & setGlyphName(const std::string &glyphName)
Change the icon to draw.
Icon & setColor(const utility::graphic::Color32Bit &color)
Set the icon color.
static std::shared_ptr< Icon > create(Arguments &&...arguments)
Build an icon without registering it in an entity registry.
State. Every class here is plain data attached to an entity.
@ None
No semantic role (decorative or container).
@ Image
Image or icon with meaning.
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 getActiveColor(SchemeColorRole role)
Get the color the active scheme gives to a role.