12#include "../layout/row_column_layout.hpp"
13#include "../geometry/module.hpp"
17namespace hi {
inline namespace v1 {
62 auto widget = std::make_unique<Widget>(
this, std::forward<Args>(args)...);
67 [[nodiscard]] generator<widget_intf &> children(
bool include_invisible)
noexcept override
69 for (
hilet& child : _children) {
70 co_yield *child.value;
74 [[nodiscard]] box_constraints update_constraints() noexcept override;
75 void set_layout(widget_layout const& context) noexcept override;
76 void draw(draw_context const& context) noexcept override;
77 hitbox hitbox_test(point2 position) const noexcept override;
78 [[nodiscard]] color focus_color() const noexcept override;
81 mutable row_layout<
std::unique_ptr<
widget>> _children;
82 mutable
float _child_height_adjustment = 0.0f;
83 size_t _spacer_index = 0;
85 void update_layout_for_child(
widget& child,
ssize_t index, widget_layout const& context) const noexcept;
95 bool tab_button_has_focus() const noexcept;
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
horizontal_alignment
Horizontal alignment.
Definition alignment.hpp:100
@ left
Align the text to the left side.
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
std::ptrdiff_t ssize_t
Signed size/index into an array.
Definition utility.hpp:177
widget_intf * parent
Pointer to the parent widget.
Definition widget_intf.hpp:27
A toolbar widget is located at the top of a window and lays out its children horizontally.
Definition toolbar_widget.hpp:34
Widget & make_widget(Args &&...args)
Add a widget directly to this toolbar-widget.
Definition toolbar_widget.hpp:60
toolbar_widget(widget *parent) noexcept
Constructs an empty row/column widget.
An interactive graphical object as part of the user-interface.
Definition widget.hpp:36
widget(widget *parent) noexcept