28#include "guillaume/ecs/component.hpp"
29#include "guillaume/ecs/entity.hpp"
61 static constexpr float Height = 56.0f;
74 std::string _label {};
75 std::string _right {};
76 bool _disabled {
false };
77 bool _collapsed {
false };
112 const std::string &
getIcon(
void)
const noexcept;
127 const std::string &
getLabel(
void)
const noexcept;
142 const std::string &
getRight(
void)
const noexcept;
ecs::Entity::Identifier getLead(void) const noexcept
Get the leading child of the destination.
static constexpr float Height
Height of a regular destination, in dp.
NavigationDrawerDestination & setIconEntity(ecs::Entity::Identifier identifier)
Record the child that draws the icon.
ecs::Entity::Identifier getLabelEntity(void) const noexcept
Get the child that draws the label.
const PressHandler & getOnPress(void) const noexcept
Get the callback run when the user presses the destination.
NavigationDrawerDestination & setIcon(const std::string &icon)
Set the icon of the destination.
~NavigationDrawerDestination(void)=default
Default destructor.
NavigationDrawerDestination & setDisabled(bool disabled)
Disable or enable the destination.
static constexpr float IconSize
Size of the icon, in dp.
NavigationDrawerDestination(void)=default
Create the configuration of an enabled, regular destination with no icon and no text.
const std::string & getLabel(void) const noexcept
Get the label of the destination.
static constexpr float CollapsedIndicatorHeight
Height of the active indicator pill of a collapsed item, in dp.
const std::string & getRight(void) const noexcept
Get the text shown at the trailing edge of a regular item.
NavigationDrawerDestination & setOnPress(PressHandler handler)
Set the callback run when the user presses the destination while it is enabled.
NavigationDrawerDestination & setRightEntity(ecs::Entity::Identifier identifier)
Record the child that draws the trailing text.
NavigationDrawerDestination & setLabel(const std::string &label)
Set the label of the destination.
static constexpr float CollapsedIndicatorWidth
Width of the active indicator pill of a collapsed item, in dp.
NavigationDrawerDestination & setCollapsed(bool collapsed)
Choose between the regular row and the collapsed (rail) rendering.
NavigationDrawerDestination & setLabelEntity(ecs::Entity::Identifier identifier)
Record the child that draws the label.
ecs::Entity::Identifier getRightEntity(void) const noexcept
Get the child that draws the trailing text.
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.
NavigationDrawerDestination & setLead(ecs::Entity::Identifier identifier)
Record the leading child of the destination.
bool isDisabled(void) const noexcept
Tell whether the destination ignores presses.
const std::string & getIcon(void) const noexcept
Get the icon of the destination.
bool isCollapsed(void) const noexcept
Tell which rendering the destination uses.
NavigationDrawerDestination & setRight(const std::string &right)
Set the text shown at the trailing edge of a regular item, such as an unread count.
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.