From 4742bf0230112dfbd12af50fa2f27b82885d4081 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Sat, 7 Mar 2026 05:08:44 -0800 Subject: [PATCH] HBoxLayout: use children --- system/ui/widgets/layouts.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/system/ui/widgets/layouts.py b/system/ui/widgets/layouts.py index 6f97fe5ed..6fd3bffd8 100644 --- a/system/ui/widgets/layouts.py +++ b/system/ui/widgets/layouts.py @@ -21,7 +21,6 @@ class HBoxLayout(Widget): def __init__(self, widgets: list[Widget] | None = None, spacing: int = 0, alignment: Alignment = Alignment.LEFT | Alignment.V_CENTER): super().__init__() - self._widgets: list[Widget] = [] self._spacing = spacing self._alignment = alignment @@ -31,13 +30,13 @@ class HBoxLayout(Widget): @property def widgets(self) -> list[Widget]: - return self._widgets + return self._children def add_widget(self, widget: Widget) -> None: - self._widgets.append(widget) + self._child(widget) def _render(self, _): - visible_widgets = [w for w in self._widgets if w.is_visible] + visible_widgets = [w for w in self._children if w.is_visible] cur_offset_x = 0