23#include "guillaume/components/app_bar.hpp"
36 if (_variant != variant) {
50 if (_title != title) {
65 _navigation = std::move(navigation);
78 _actions = std::move(actions);
90 if (_elevated != elevated) {
99 return _navigationButton;
104 if (_navigationButton != identifier) {
105 _navigationButton = identifier;
118 if (_titleEntity != identifier) {
119 _titleEntity = identifier;
127 return _actionButtons;
132 if (_actionButtons != identifiers) {
133 _actionButtons = identifiers;
ecs::Entity::Identifier getNavigationButton(void) const noexcept
Get the icon button child built for the navigation action.
Variant getVariant(void) const noexcept
Get the shape of the bar.
AppBar & setTitleEntity(ecs::Entity::Identifier identifier)
Record the text child that displays the title.
AppBar(void)=default
Create the configuration of a small, flat bar with no title and no icon.
AppBar & setVariant(Variant variant)
Set the shape of the bar, which decides its height and the size of its title.
bool isElevated(void) const noexcept
Tell whether the bar is elevated.
AppBar & setElevated(bool elevated)
Raise or flatten the bar.
ecs::Entity::Identifier getTitleEntity(void) const noexcept
Get the text child that displays the title.
const Identifiers & getActionButtons(void) const noexcept
Get the icon button children built for the trailing actions.
std::vector< ecs::Entity::Identifier > Identifiers
Identifiers of child entities, in display order.
AppBar & setNavigationButton(ecs::Entity::Identifier identifier)
Record the icon button child built for the navigation action.
const std::string & getTitle(void) const noexcept
Get the title shown in the bar.
AppBar & setActionButtons(const Identifiers &identifiers)
Record the icon button children built for the trailing actions.
Variant
Shape of the bar. It sets the height and the title size.
AppBar & setTitle(const std::string &title)
Set the title shown in the bar.
AppBar & setNavigation(Action navigation)
Set the leading navigation action.
AppBar & setActions(std::vector< Action > actions)
Replace the trailing actions.
const Action & getNavigation(void) const noexcept
Get the leading navigation action (back arrow, menu icon).
const std::vector< Action > & getActions(void) const noexcept
Get the trailing actions.
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.
One pressable icon of the bar: the leading navigation icon or a trailing action.