9 : visible(other.visible)
10 , enabled(other.enabled)
11 , focusable(other.focusable)
12 , nav_up(other.nav_up)
13 , nav_down(other.nav_down)
14 , nav_left(other.nav_left)
15 , nav_right(other.nav_right)
16 , focus_ring(other.focus_ring)
17 , transform(other.transform)
18 , anchor(other.anchor)
19 , anchor_margin(other.anchor_margin)
20 , _children(std::move(other._children))
32 visible = other.visible;
33 enabled = other.enabled;
34 focusable = other.focusable;
35 nav_up = other.nav_up;
36 nav_down = other.nav_down;
37 nav_left = other.nav_left;
38 nav_right = other.nav_right;
39 focus_ring = other.focus_ring;
40 transform = other.transform;
41 anchor = other.anchor;
42 anchor_margin = other.anchor_margin;
46 _children = std::move(other._children);
61 for (
auto& c : _children) {
63 _removed.push_back(std::move(c));
75 for (
auto const& c : _children) {
86 const auto& area = transform;
126 const auto along = [](
int part,
float start,
float extent,
float own,
float gap) {
131 return start + extent - own - gap;
133 return start + ((extent - own) / 2.0F);
136 child.
transform.
position = { along(col, area.position.x, area.size.x, size.x, margin.x),
137 along(row, area.position.y, area.size.y, size.y, margin.y) };
160 return _pressed || _hovered || (_focused && ctx.
show_focus);
165 for (
auto const& c : _children) {
174 const auto it = std::ranges::find_if(
175 _children, [&child](
const std::unique_ptr<Widget>& c) {
return c.get() == &child; });
176 if (it == _children.end()) {
179 (*it)->parent =
nullptr;
180 _removed.push_back(std::move(*it));
Vec2< T > size
The size of the rectangle.
Vec2< T > position
The position of the rectangle.
Shared state for the UI system.
bool show_focus
Whether focus is shown. Root turns it on for keyboard and controller navigation and off when the mous...
UI context and focus management for the ASW UI module.
Event structure for UI interactions.