12#include "../layout/row_column_layout.hpp"
17namespace hi {
inline namespace v1 {
59 template<
typename Widget, horizontal_alignment Alignment = horizontal_alignment::left,
typename... Args>
62 auto widget = std::make_shared<Widget>(
this, std::forward<Args>(args)...);
67 [[nodiscard]] generator<widget *> children() const noexcept
override
69 for (
hilet& child : _children) {
70 co_yield child.value.get();
74 [[nodiscard]] box_constraints update_constraints() noexcept;
75 void set_layout(widget_layout const& context) noexcept override;
76 void draw(draw_context const& context) noexcept override;
77 hitbox hitbox_test(point2i position) const noexcept override;
78 [[nodiscard]] color focus_color() const noexcept override;
81 mutable row_layout<
std::shared_ptr<
widget>> _children;
82 mutable
int _child_height_adjustment = 0;
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
types and utilities for alignment.
DOXYGEN BUG.
Definition algorithm.hpp:15
geometry/margins.hpp
Definition assert.hpp:18
std::ptrdiff_t ssize_t
Signed size/index into an array.
Definition utility.hpp:173
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:46
widget(widget *parent) noexcept
widget * parent
Pointer to the parent widget.
Definition widget.hpp:51