From 9d8d37e110644149fbefb1c5b2734072ed9aeb27 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Wed, 12 Aug 2026 00:54:14 +0900 Subject: [PATCH] chore: move ShortHBox to generics --- dzgui/views/components/box.py | 7 +++++++ dzgui/views/pages/options.py | 9 +-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dzgui/views/components/box.py b/dzgui/views/components/box.py index be64f82..4e1772f 100644 --- a/dzgui/views/components/box.py +++ b/dzgui/views/components/box.py @@ -23,3 +23,10 @@ class HBox(GenericBox): class VBox(GenericBox): def __init__(self, spacing: int = 0) -> None: super().__init__(orientation=Gtk.Orientation.VERTICAL, spacing=spacing) + +class ShortHBox(HBox): + def __init__(self, widget: Gtk.Widget) -> None: + super().__init__(spacing=5) + + self.set_halign(Gtk.Align.START) + self.pack_start(widget, expand=False, fill=False, padding=0) diff --git a/dzgui/views/pages/options.py b/dzgui/views/pages/options.py index 91c16c0..ff97e2e 100644 --- a/dzgui/views/pages/options.py +++ b/dzgui/views/pages/options.py @@ -20,7 +20,7 @@ from dzgui.const.enum import Preferences, ServerTab from dzgui.strings import errors, options from dzgui.util import strings, css, open_links -from dzgui.views.components.box import VBox +from dzgui.views.components.box import ShortHBox, VBox from dzgui.views.components.eventbox import InfoEventBox from dzgui.views.components.labels import LeftLabel from dzgui.views.components.buttons import WebButton @@ -71,13 +71,6 @@ class ToggleField(Gtk.Box): el.set_sensitive(state) -class ShortHBox(Gtk.Box): - def __init__(self, widget: Gtk.Widget) -> None: - super().__init__(spacing=5, halign=Gtk.Align.START) - - self.pack_start(widget, NO_EXPAND, NO_FILL, NO_PADDING) - - class Options(ScrollableMixin, Gtk.ScrolledWindow): # type: ignore def __init__(self, controller: "Controller"): super().__init__(