23#include "guillaume/components/badge.hpp"
36 if (_variant != variant) {
50 if (_label != label) {
64 if (_labelEntity != identifier) {
65 _labelEntity = identifier;
85 const std::optional<utility::graphic::Color32Bit> &
88 return _containerColor;
92 std::optional<utility::graphic::Color32Bit> color)
94 if (_containerColor != color) {
95 _containerColor = color;
101 const std::optional<utility::graphic::Color32Bit> &
104 return _contentColor;
108 std::optional<utility::graphic::Color32Bit> color)
110 if (_contentColor != color) {
111 _contentColor = color;
124 if (_visible != visible) {
138 if (_opacity != opacity) {
152 if (_fadeFrom != opacity) {
Badge & setVisible(bool visible)
Store the visibility the fade heads to.
Badge & setLabelEntity(ecs::Entity::Identifier identifier)
Record which child entity draws the label.
const std::string & getLabel(void) const noexcept
Get the label text.
Variant
Kind of badge; it sets the height and whether a label is shown.
ecs::Entity::Identifier getLabelEntity(void) const noexcept
Get the child entity that draws the label.
Badge & setSize(std::optional< float > size)
Replace the height of the variant.
Badge(void)=default
Create the state of a visible Large badge with no label.
const std::optional< utility::graphic::Color32Bit > & getContentColor(void) const noexcept
Get the color that replaces the themed label color.
Badge & setVariant(Variant variant)
Choose the kind of badge.
Badge & setFadeFrom(float opacity)
Record the opacity a fade starts from.
Badge & setOpacity(float opacity)
Set the opacity the badge is drawn with.
bool isVisible(void) const noexcept
Check whether the badge is shown or fading in.
const std::optional< float > & getSize(void) const noexcept
Get the height that replaces the one of the variant.
Badge & setContentColor(std::optional< utility::graphic::Color32Bit > color)
Replace the themed label color.
float getOpacity(void) const noexcept
Get the opacity the badge is drawn with.
Badge & setLabel(const std::string &label)
Set the label text.
Variant getVariant(void) const noexcept
Get the kind of badge.
float getFadeFrom(void) const noexcept
Get the opacity the running fade started from.
Badge & setContainerColor(std::optional< utility::graphic::Color32Bit > color)
Replace the themed container (background) color.
const std::optional< utility::graphic::Color32Bit > & getContainerColor(void) const noexcept
Get the color that replaces the themed container color.
void setHasChanged(bool hasChanged)
Raise or lower the changed flag.
std::size_t Identifier
The key under which an entity's components are stored. Systems and components refer to entities by th...
State. Every class here is plain data attached to an entity.