28#include "guillaume/ecs/component.hpp"
29#include "guillaume/ecs/entity.hpp"
75 std::string _focusedIcon {};
76 std::string _label {};
77 std::string _badge {};
78 bool _showLabel {
true };
113 const std::string &
getIcon(
void)
const noexcept;
146 const std::string &
getLabel(
void)
const noexcept;
162 const std::string &
getBadge(
void)
const noexcept;
NavigationBarDestination & setLabelEntity(ecs::Entity::Identifier identifier)
Record the child that draws the label.
NavigationBarDestination & setBadge(const std::string &badge)
Set the text of the badge.
ecs::Entity::Identifier getIndicator(void) const noexcept
Get the pill drawn behind the icon of the selected destination.
NavigationBarDestination & setOnPress(PressHandler handler)
Set the callback run when the user presses the destination.
const PressHandler & getOnPress(void) const noexcept
Get the callback run when the user presses the destination.
NavigationBarDestination & setLabel(const std::string &label)
Set the text shown under the icon.
NavigationBarDestination(void)=default
Create the configuration of a destination with no icon, no text and a visible label.
~NavigationBarDestination(void)=default
Default destructor.
std::function< void(void)> PressHandler
Callback run when the user presses the destination.
ecs::Entity::Identifier getIconEntity(void) const noexcept
Get the child that draws the icon.
NavigationBarDestination & setIconEntity(ecs::Entity::Identifier identifier)
Record the child that draws the icon.
static constexpr float IndicatorHeight
Height of the active indicator pill, in dp.
NavigationBarDestination & setIcon(const std::string &icon)
Set the icon shown while the destination is not selected.
static constexpr float IconSize
Size of the icon, in dp.
static constexpr float BadgeOffsetY
Vertical offset of the badge from the indicator origin, in dp.
static constexpr float BadgeOffsetX
const std::string & getLabel(void) const noexcept
Get the text shown under the icon.
NavigationBarDestination & setBadgeEntity(ecs::Entity::Identifier identifier)
Record the child that draws the badge.
const std::string & getFocusedIcon(void) const noexcept
Get the icon shown while the destination is selected.
NavigationBarDestination & setFocusedIcon(const std::string &icon)
Set the icon shown while the destination is selected, typically the filled version of the unselected ...
ecs::Entity::Identifier getBadgeEntity(void) const noexcept
Get the child that draws the badge.
NavigationBarDestination & setShowLabel(bool show)
Show or hide the label.
static constexpr float IndicatorWidth
Width of the active indicator pill, in dp.
NavigationBarDestination & setIndicator(ecs::Entity::Identifier identifier)
Record the active indicator pill child.
const std::string & getIcon(void) const noexcept
Get the icon shown while the destination is not selected.
ecs::Entity::Identifier getLabelEntity(void) const noexcept
Get the child that draws the label.
const std::string & getBadge(void) const noexcept
Get the text of the badge.
bool isLabelShown(void) const noexcept
Tell whether the label is visible.
Base class of every component: a piece of state attached to an entity, plus a "changed" flag.
std::size_t Identifier
The key under which an entity's components are stored. Systems and components refer to entities by th...
static constexpr Identifier InvalidIdentifier
"No entity": never the identifier of a real entity
State. Every class here is plain data attached to an entity.