12#include "grid_layout.hpp"
17namespace hi {
inline namespace v1 {
60 template<
typename Widget, horizontal_alignment Alignment = horizontal_alignment::left,
typename... Args>
63 auto widget = std::make_unique<Widget>(
window,
this, std::forward<Args>(args)...);
68 [[nodiscard]] generator<widget *> children() const noexcept
override
70 for (
hilet& child : _left_children) {
73 for (
hilet& child :
std::ranges::reverse_view(_right_children)) {
78 widget_constraints
const& set_constraints() noexcept;
79 void set_layout(widget_layout const&
layout) noexcept override;
80 void draw(draw_context const& context) noexcept override;
81 hitbox hitbox_test(point3 position) const noexcept override;
82 [[nodiscard]] color focus_color() const noexcept override;
87 grid_layout _grid_layout;
88 margins _inner_margins;
90 void update_constraints_for_child(
94 float& shared_top_margin,
95 float& shared_bottom_margin,
96 widget_baseline& shared_baseline) noexcept;
98 void update_layout_for_child(
widget& child,
ssize_t index, widget_layout const& context) const noexcept;
108 bool tab_button_has_focus() const noexcept;
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
DOXYGEN BUG.
Definition algorithm.hpp:15
The HikoGUI namespace.
Definition ascii.hpp:19
std::ptrdiff_t ssize_t
Signed size/index into an array.
Definition utility.hpp:162
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:61
toolbar_widget(gui_window &window, widget *parent) noexcept
Constructs an empty row/column widget.
An interactive graphical object as part of the user-interface.
Definition widget.hpp:44
widget_layout const & layout() const noexcept
Get the current layout for this widget.
Definition widget.hpp:198
widget *const parent
Pointer to the parent widget.
Definition widget.hpp:53
widget(gui_window &window, widget *parent) noexcept
gui_window & window
Convenient reference to the Window.
Definition widget.hpp:48