mirror of
https://github.com/aclist/dztui.git
synced 2026-08-26 09:47:36 +02:00
chore: consolidate buttons
This commit is contained in:
parent
d74060c518
commit
69cde11e8e
@ -27,33 +27,36 @@ class ModSelectionPanel(Gtk.Box):
|
||||
|
||||
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 = (
|
||||
ModButton.SELECT_ALL,
|
||||
ModButton.UNSELECT_ALL,
|
||||
ModButton.HIGHLIGHT_STALE,
|
||||
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:
|
||||
b = EnumeratedModButton(button)
|
||||
b.connect("clicked", self._on_button_clicked)
|
||||
self.main_panel.pack_start(b, NO_EXPAND, FILL, NO_PADDING)
|
||||
|
||||
self.extra_panel = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
|
||||
for button in (ModButton.SELECT_STALE, ModButton.UNHIGHLIGHT_STALE):
|
||||
self.stale_panel = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
|
||||
buttons = (
|
||||
ModButton.HIGHLIGHT_STALE,
|
||||
ModButton.SELECT_STALE,
|
||||
ModButton.UNHIGHLIGHT_STALE,
|
||||
)
|
||||
for button in buttons:
|
||||
b = EnumeratedModButton(button)
|
||||
b.connect("clicked", self._on_button_clicked)
|
||||
b.set_sensitive(False)
|
||||
self.extra_panel.pack_start(b, NO_EXPAND, FILL, NO_PADDING)
|
||||
if button is not ModButton.HIGHLIGHT_STALE:
|
||||
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)
|
||||
self.pack_start(self.main_panel, NO_EXPAND, FILL, NO_PADDING)
|
||||
self.pack_start(self.extra_panel, NO_EXPAND, FILL, NO_PADDING)
|
||||
for el in header, self.main_panel, self.stale_panel:
|
||||
self.pack_start(el, NO_EXPAND, FILL, NO_PADDING)
|
||||
|
||||
def after_colorize(self) -> None:
|
||||
self.controller.unselect_all_mods()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user