5#ifndef MALENA_TOOLBAR_H
6#define MALENA_TOOLBAR_H
94 std::unique_ptr<ml::Core> owned;
95 std::function<void()> action;
97 bool separator =
false;
100 bool selected =
false;
103 Item(Item&&) =
default;
107 std::vector<Item> _items;
109 float _barLength = 0.f;
110 float _scrollOffsetX = 0.f;
111 float _totalItemsLen = 0.f;
112 mutable int _rowCount = 1;
113 int _hoveredIdx = -1;
135 static_assert(std::is_base_of_v<ToolbarSettings, S>,
136 "applySettings() requires ToolbarSettings");
144 static_assert(std::is_base_of_v<ToolbarTheme, T>,
145 "applyTheme() requires ToolbarTheme");
149 template<
typename St>
152 static_assert(std::is_base_of_v<ToolbarSettings, St> &&
153 std::is_base_of_v<ToolbarTheme, St>,
154 "applyStyle() requires ToolbarSettings and ToolbarTheme");
164 std::function<
void()> action = {});
208 [[nodiscard]] std::size_t
itemCount()
const {
return _items.size(); }
235 template<
typename MANIFEST>
Virtual base class for all Malena framework objects.
static const sf::Font & getDefault()
Return the built-in Arial font.
Base class for all Malena manifests.
Component< M, Traits... > ComponentWith
Alias for Component<M, Traits...>.
Vector2< float > Vector2f
Universal design token set applied across all Themeable components.