8#include "../flow_layout.hpp"
56 template<
typename Widget,
horizontal_alignment Alignment = horizontal_alignment::left,
typename... Args>
59 auto widget = std::make_unique<Widget>(
window,
this, std::forward<Args>(args)...);
65 [[nodiscard]]
float margin() const noexcept override;
66 [[nodiscard]]
bool constrain(
hires_utc_clock::time_point display_time_point,
bool need_reconstrain) noexcept;
67 void layout(
hires_utc_clock::time_point display_time_point,
bool need_layout) noexcept override;
69 hitbox hitbox_test(
point2 position) const noexcept override;
76 void update_constraints_for_child(
widget const &child,
ssize_t index,
float &shared_height) noexcept;
78 void update_layout_for_child(
widget &child,
ssize_t index) const noexcept;
horizontal_alignment
Horizontal alignment.
Definition alignment.hpp:31
alignment
Vertical and horizontal alignment.
Definition alignment.hpp:47
Layout algorithm.
Definition flow_layout.hpp:52
Draw context for drawing using the TTauri shaders.
Definition draw_context.hpp:29
Definition gui_window.hpp:36
Timestamp.
Definition hires_utc_clock.hpp:19
A toolbar widget is located at the top of a window and lays out its children horizontally.
Definition toolbar_widget.hpp:28
Widget & make_widget(Args &&...args)
Add a widget directly to this toolbar-widget.
Definition toolbar_widget.hpp:57
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:39
widget *const parent
Pointer to the parent widget.
Definition widget.hpp:48
virtual void init() noexcept
Should be called right after allocating and constructing a widget.
gui_window & window
Convenient reference to the Window.
Definition widget.hpp:43
widget(gui_window &window, widget *parent) noexcept