30#include "guillaume/ecs/parent_entity_filler.hpp"
32#include "guillaume/components/borders.hpp"
33#include "guillaume/components/bound.hpp"
34#include "guillaume/components/color.hpp"
35#include "guillaume/components/layout.hpp"
36#include "guillaume/components/navigation_bar_destination.hpp"
37#include "guillaume/components/selection.hpp"
38#include "guillaume/components/transform.hpp"
40#include "guillaume/entities/icon.hpp"
41#include "guillaume/entities/text.hpp"
42#include "guillaume/entities/view.hpp"
43#include "guillaume/entities/badge.hpp"
44#include "guillaume/entities/navigation_bar.hpp"
46namespace guillaume::entities::detail
71 public std::enable_shared_from_this<BarDestination>,
73 components::Layout, components::Transform, components::Bound,
74 components::Color, components::Borders, components::Selectable,
75 components::NavigationBarDestination>
91 template<
typename... Arguments>
92 static std::shared_ptr<BarDestination>
create(Arguments &&...arguments)
94 std::shared_ptr<BarDestination> entity(
95 new BarDestination(std::forward<Arguments>(arguments)...));
113 void setOnPress(std::function<
void(
void)> onPress);
123 void setBadge(
const std::string &badge);
190 void buildBadge(
void);
std::function< void(bool)> Handler
Callback receiving the new state: true when just selected.
Stores every component of a scene, per component type and per entity identifier, and knows which ones...
std::size_t Identifier
The key under which an entity's components are stored. Systems and components refer to entities by th...
The base class of a widget with children: an EntityFiller that is also a ParentEntity.
components::NavigationBar::Destination Destination
void setOnPress(std::function< void(void)> onPress)
Set the handler called when the user presses the destination.
~BarDestination(void) override=default
Default destructor.
void setOnSelectionChanged(const components::Selectable::Handler &handler)
Set the handler of the destination's components::Selectable.
ecs::Entity::Identifier getLabelIdentifier(void) const
Get the label entity.
bool isSelected(void) const
Whether the destination is the selected one of its bar.
ecs::Entity::Identifier getIconIdentifier(void) const
Get the icon entity.
ecs::Entity::Identifier getIndicatorIdentifier(void) const
Get the active-indicator pill: the rounded shape behind the icon.
static std::shared_ptr< BarDestination > create(Arguments &&...arguments)
Create a destination and its children, without registering it in an entity registry or setting its pa...
void setShowLabel(bool show)
Show or hide the label. Restyles at once.
ecs::Entity::Identifier getBadgeIdentifier(void) const
Get the badge entity.
void setBadge(const std::string &badge)
Change the badge label.