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_drawer_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/navigation_drawer.hpp"
45namespace guillaume::entities::detail
72 class DrawerDestination:
73 public std::enable_shared_from_this<DrawerDestination>,
75 components::Layout, components::Transform, components::Bound,
76 components::Color, components::Borders, components::Selectable,
77 components::NavigationDrawerDestination>
93 template<
typename... Arguments>
94 static std::shared_ptr<DrawerDestination>
97 std::shared_ptr<DrawerDestination> entity(
98 new DrawerDestination(std::forward<Arguments>(arguments)...));
116 void setOnPress(std::function<
void(
void)> onPress);
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::NavigationDrawer::Entry Entry
static std::shared_ptr< DrawerDestination > create(Arguments &&...arguments)
Create a destination and its children, without registering it in an entity registry or setting its pa...
~DrawerDestination(void) override=default
Default destructor.
void setDisabled(bool disabled)
Enable or disable the destination. Restyles at once.
bool isSelected(void) const
Whether the destination is the selected one of its drawer.
void setOnPress(std::function< void(void)> onPress)
Set the handler called when the user presses the destination while it is enabled.
ecs::Entity::Identifier getRightIdentifier(void) const
Get the trailing text entity.
void setOnSelectionChanged(const components::Selectable::Handler &handler)
Set the handler of the destination's components::Selectable.
bool isDisabled(void) const
Whether the destination ignores presses.