12#include "../GUI/GUI.hpp"
13#include "../geometry/module.hpp"
14#include "../layout/module.hpp"
15#include "../macros.hpp"
19namespace hi {
inline namespace v1 {
43 static_assert(
Axis == axis::horizontal
or Axis == axis::vertical);
56 hi_axiom(loop::main().on_thread());
78 auto tmp = std::make_unique<Widget>(
this, std::forward<Args>(args)...);
82 ++global_counter<
"row_column_widget:make_widget:constrain">;
91 hi_axiom(loop::main().on_thread());
93 ++global_counter<
"row_column_widget:clear:constrain">;
100 for (hilet& child : _children) {
101 co_yield *child.value;
109 for (
auto& child : _children) {
110 child.set_constraints(child.value->update_constraints());
113 return _children.constraints(os_settings::left_to_right());
116 void set_layout(widget_layout
const&
context)
noexcept override
119 _children.set_layout(
context.shape, theme().baseline_adjustment());
121 for (hilet& child : _children) {
122 child.value->set_layout(
context.transform(child.shape, 0.0f));
127 void draw(draw_context
const&
context)
noexcept override
130 for (hilet& child : _children) {
136 hitbox hitbox_test(point2 position)
const noexcept override
138 hi_axiom(loop::main().on_thread());
142 for (hilet& child : _children) {
143 r = child.value->hitbox_test_from_parent(position, r);
axis
An enumeration of the 3 axis for 3D geometry.
Definition axis.hpp:19
@ window_reconstrain
Request that widget get constraint on the next frame.
@ partial
A widget is partially enabled.
@ invisible
The widget is invisible.
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
bool compare_store(T &lhs, U &&rhs) noexcept
Compare then store if there was a change.
Definition misc.hpp:56
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
widget_intf * parent
Pointer to the parent widget.
Definition widget_intf.hpp:28
A row/column widget lays out child widgets along a row or column.
Definition row_column_widget.hpp:41
Widget & make_widget(Args &&...args)
Add a widget directly to this grid-widget.
Definition row_column_widget.hpp:76
void clear() noexcept
Remove and deallocate all child widgets.
Definition row_column_widget.hpp:89
row_column_widget(widget *parent) noexcept
Constructs an empty row/column widget.
Definition row_column_widget.hpp:54
An interactive graphical object as part of the user-interface.
Definition widget.hpp:37
int semantic_layer
The draw layer of the widget.
Definition widget.hpp:66
widget(widget *parent) noexcept
Definition widget.hpp:87
bool process_event(gui_event const &event) const noexcept override
Send a event to the window.
Definition widget.hpp:178
observer< widget_mode > mode
The widget mode.
Definition widget.hpp:42