mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 14:42:54 +01:00
chore: consolidate buttons
This commit is contained in:
1 parent
d74060c518
commit
69cde11e8e
1 file changed
+17
-14
@@ -27,33 +27,36 @@ class ModSelectionPanel(Gtk.Box):
|
|||||||
|
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
|
|
||||||
|
header = Gtk.Label()
|
||||||
|
text = embolden(mod_panel.header)
|
||||||
|
header.set_markup(text)
|
||||||
|
|
||||||
|
self.main_panel = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
|
||||||
buttons = (
|
buttons = (
|
||||||
ModButton.SELECT_ALL,
|
ModButton.SELECT_ALL,
|
||||||
ModButton.UNSELECT_ALL,
|
ModButton.UNSELECT_ALL,
|
||||||
ModButton.HIGHLIGHT_STALE,
|
|
||||||
ModButton.DELETE_SELECTED,
|
ModButton.DELETE_SELECTED,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.header = Gtk.Label()
|
|
||||||
text = embolden(mod_panel.header)
|
|
||||||
self.header.set_markup(text)
|
|
||||||
|
|
||||||
self.main_panel = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
|
|
||||||
for button in buttons:
|
for button in buttons:
|
||||||
b = EnumeratedModButton(button)
|
b = EnumeratedModButton(button)
|
||||||
b.connect("clicked", self._on_button_clicked)
|
b.connect("clicked", self._on_button_clicked)
|
||||||
self.main_panel.pack_start(b, NO_EXPAND, FILL, NO_PADDING)
|
self.main_panel.pack_start(b, NO_EXPAND, FILL, NO_PADDING)
|
||||||
|
|
||||||
self.extra_panel = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
|
self.stale_panel = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
|
||||||
for button in (ModButton.SELECT_STALE, ModButton.UNHIGHLIGHT_STALE):
|
buttons = (
|
||||||
|
ModButton.HIGHLIGHT_STALE,
|
||||||
|
ModButton.SELECT_STALE,
|
||||||
|
ModButton.UNHIGHLIGHT_STALE,
|
||||||
|
)
|
||||||
|
for button in buttons:
|
||||||
b = EnumeratedModButton(button)
|
b = EnumeratedModButton(button)
|
||||||
b.connect("clicked", self._on_button_clicked)
|
b.connect("clicked", self._on_button_clicked)
|
||||||
b.set_sensitive(False)
|
if button is not ModButton.HIGHLIGHT_STALE:
|
||||||
self.extra_panel.pack_start(b, NO_EXPAND, FILL, NO_PADDING)
|
b.set_sensitive(False)
|
||||||
|
self.stale_panel.pack_start(b, NO_EXPAND, FILL, NO_PADDING)
|
||||||
|
|
||||||
self.pack_start(self.header, NO_EXPAND, FILL, NO_PADDING)
|
for el in header, self.main_panel, self.stale_panel:
|
||||||
self.pack_start(self.main_panel, NO_EXPAND, FILL, NO_PADDING)
|
self.pack_start(el, NO_EXPAND, FILL, NO_PADDING)
|
||||||
self.pack_start(self.extra_panel, NO_EXPAND, FILL, NO_PADDING)
|
|
||||||
|
|
||||||
def after_colorize(self) -> None:
|
def after_colorize(self) -> None:
|
||||||
self.controller.unselect_all_mods()
|
self.controller.unselect_all_mods()
|
||||||
|
|||||||
Reference in new issue
Block a user