|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Configures Icon widgets and registers them in the scene's entity registry. More...
#include <headers/guillaume/entities/icon.hpp>
Public Member Functions | |
| Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder holding the defaults of reset(). | |
| std::shared_ptr< Icon > | buildEntity (void) override |
| Build an icon from the current configuration, without registering it or giving it a parent. | |
| void | reset (void) override |
| Restore the defaults: empty glyph name, font size 24, the OnSurface color of the active theme, and the Outlined style. | |
| 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. | |
| 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. | |
| Public Member Functions inherited from guillaume::entities::EntityBuilderBase< Icon > | |
| EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder bound to two registries. | |
| ~EntityBuilderBase (void) override=default | |
| Default destructor. | |
| std::shared_ptr< Icon > | registerEntity (std::shared_ptr< ecs::Entity > parent) |
| Build the widget, attach it to its parent, hand it to the entity registry, then reset the builder to its defaults. | |
| Public Member Functions inherited from guillaume::ecs::EntityBuilder | |
| EntityBuilder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Create a builder working on a pair of registries, normally those of one scene. | |
| virtual | ~EntityBuilder (void)=default |
| Virtual destructor. | |
Additional Inherited Members | |
| Protected Member Functions inherited from guillaume::ecs::EntityBuilder | |
| ComponentRegistry & | getComponentRegistry (void) |
| Get the registry in which the builder creates components. | |
| EntityRegistry & | getEntityRegistry (void) |
| Get the registry in which the builder registers the entities it creates. | |
Configures Icon widgets and registers them in the scene's entity registry.
| guillaume::entities::Icon::Builder::Builder | ( | ecs::ComponentRegistry & | componentRegistry, |
| ecs::EntityRegistry & | entityRegistry ) |
|
overridevirtual |
Build an icon from the current configuration, without registering it or giving it a parent.
Implements guillaume::entities::EntityBuilderBase< Icon >.
Definition at line 39 of file icon.cpp.
| std::shared_ptr< Icon > guillaume::entities::Icon::Builder::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.
| parent | The entity the icon is attached to, or nullptr for a root entity. |
| iconName | The Material Symbols name of the icon, such as "favorite". |
| fontSize | The font size of the glyph, in dp. |
| color | The icon color (RGBA). |
| style | The Material Symbols style of the glyph. |
Definition at line 80 of file icon.cpp.
|
overridevirtual |
Restore the defaults: empty glyph name, font size 24, the OnSurface color of the active theme, and the Outlined style.
Implements guillaume::ecs::EntityBuilder.
Definition at line 46 of file icon.cpp.
| Icon::Builder & guillaume::entities::Icon::Builder::withColor | ( | const utility::graphic::Color32Bit & | color | ) |
Set the icon color.
| color | The color (RGBA). By default the OnSurface color the active theme had when the builder was last reset. |
Definition at line 67 of file icon.cpp.
| Icon::Builder & guillaume::entities::Icon::Builder::withFontSize | ( | float | fontSize | ) |
| Icon::Builder & guillaume::entities::Icon::Builder::withGlyphName | ( | const std::string & | glyphName | ) |
Choose the icon to draw.
| glyphName | The Material Symbols name of the icon, such as "favorite". Empty by default. |
Definition at line 54 of file icon.cpp.
| Icon::Builder & guillaume::entities::Icon::Builder::withStyle | ( | const components::Glyph::Style & | style | ) |
Set the Material Symbols style of the glyph.
| style | The style stored in components::Glyph. Outlined by default. |
Definition at line 74 of file icon.cpp.