|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Configures, creates and registers Chip widgets. More...
#include <headers/guillaume/entities/chip.hpp>


Public Member Functions | |
| Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder with the default configuration (see reset()). | |
| std::shared_ptr< Chip > | buildEntity (void) override |
| Build a Chip, with its icon and label children, from the current configuration, without registering it. | |
| void | reset (void) override |
| Restore the default configuration. | |
| Builder & | withPose (const utility::graphic::PoseF &pose) |
| Set the position and orientation of the chip. | |
| Builder & | withVariant (Variant variant) |
| Set the variant, which decides the children built and whether a press toggles the selection. | |
| Builder & | withLabel (const std::string &label) |
| Set the label text. | |
| Builder & | withIcon (const std::string &iconGlyph) |
| Set the leading icon. | |
| Builder & | withSelected (bool selected) |
| Choose whether the chip starts selected. | |
| std::shared_ptr< Chip > | makeChip (std::shared_ptr< ecs::Entity > parent, Variant variant, const std::string &label, const std::string &iconGlyph, bool selected) |
| Build a chip, register it under parent and reset the builder. | |
| Public Member Functions inherited from guillaume::entities::EntityBuilderBase< Chip > | |
| EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder bound to two registries. | |
| ~EntityBuilderBase (void) override=default | |
| Default destructor. | |
| std::shared_ptr< Chip > | 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, creates and registers Chip widgets.
Set options with the with... methods then call registerEntity(), or use makeChip() to do both in one call.
| guillaume::entities::Chip::Builder::Builder | ( | ecs::ComponentRegistry & | componentRegistry, |
| ecs::EntityRegistry & | entityRegistry ) |
Construct a builder with the default configuration (see reset()).
| componentRegistry | The registry that stores the components of the chips to build. |
| entityRegistry | The registry the built chips are added to (usually the scene's). |
Definition at line 37 of file chip.cpp.

|
overridevirtual |
Build a Chip, with its icon and label children, from the current configuration, without registering it.
registerEntity() calls it, then sets the parent, registers the chip and resets the builder.
Implements guillaume::entities::EntityBuilderBase< Chip >.
Definition at line 44 of file chip.cpp.

| std::shared_ptr< Chip > guillaume::entities::Chip::Builder::makeChip | ( | std::shared_ptr< ecs::Entity > | parent, |
| Variant | variant, | ||
| const std::string & | label, | ||
| const std::string & | iconGlyph, | ||
| bool | selected ) |
Build a chip, register it under parent and reset the builder.
A pose set before the call with withPose() also applies.
| parent | The entity the chip becomes a child of. |
| variant | The variant. |
| label | The text shown in the chip. |
| iconGlyph | The glyph name of the leading icon; may be empty. |
| selected | True for a chip that starts selected. |
Definition at line 101 of file chip.cpp.

|
overridevirtual |
Restore the default configuration.
Defaults: Variant::Assist, empty label, no icon glyph, not selected, default pose. The pill is a horizontal row with centered content, 8 dp between children, 12 dp of padding, a fixed height of 32 dp and the theme's small corner radius.
Implements guillaume::ecs::EntityBuilder.
Definition at line 51 of file chip.cpp.


| Chip::Builder & guillaume::entities::Chip::Builder::withIcon | ( | const std::string & | iconGlyph | ) |
Set the leading icon.
| iconGlyph | The glyph name of the leading icon. Default: empty, which means no leading icon, except for an Assist chip which then shows components::Chip::DefaultAssistGlyph. |
| Chip::Builder & guillaume::entities::Chip::Builder::withLabel | ( | const std::string & | label | ) |
| Chip::Builder & guillaume::entities::Chip::Builder::withPose | ( | const utility::graphic::PoseF & | pose | ) |
| Chip::Builder & guillaume::entities::Chip::Builder::withSelected | ( | bool | selected | ) |
| Chip::Builder & guillaume::entities::Chip::Builder::withVariant | ( | Variant | variant | ) |