fix: connect signals to new notebook tabs

This commit is contained in:
aclist committed 2025-12-21 03:01:55 +09:00
1 parent e281345323
commit 8b3d8c94fd
10 files changed
+137 -197

No files matched your search

+4 -1
View File
@@ -29,7 +29,6 @@ class ButtonBox(Gtk.Box):
orientation=Gtk.Orientation.VERTICAL,
)
self.prior_button = ButtonType.MAIN_MENU
self.controller = controller
self.buttons = list()
self.connect("key-press-event", self._on_keypress)
@@ -56,6 +55,10 @@ class ButtonBox(Gtk.Box):
def _on_selection_button_clicked(self, button: Gtk.Button) -> None:
self.controller.open_page_by_button(button)
button.set_sensitive(False)
for b in self.buttons:
if b != button:
b.set_sensitive(True)
def _walk_buttons(self, increment: int) -> None:
for i, button in enumerate(self.buttons):
+20 -5
View File
@@ -2,16 +2,31 @@ import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk # noqa E402
from dzgui.views.components.web_button import WebButton
class ConnectPanel(Gtk.Grid):
def __init__(self) -> None:
super().__init__()
super().__init__(vexpand=False, margin=20)
self.label = Gtk.Label(label="Connect by IP/ID")
self.label2 = Gtk.Label(label="Save server by IP/ID")
self.entry1 = Gtk.Entry()
self.label2 = Gtk.Label(label="Favorite server")
# TODO: embold function
self.label2.set_markup("<b>Favorite server</b>")
sep = Gtk.Separator()
self.entry1 = Gtk.Entry(placeholder_text="Enter IP or Battlemetrics ID", hexpand=False)
self.entry2 = Gtk.Entry()
self.fav = Gtk.Label("MY favorite server")
self.favedit = Gtk.Button("Edit")
self.edit = WebButton(label="EDIT")
self.favbutton = Gtk.Button(label="Connect")
self.attach(self.label, 0, 0, 3, 1)
button = Gtk.Button(label="Connect")
self.attach_next_to(self.entry1, self.label, Gtk.PositionType.BOTTOM, 3, 1)
self.attach_next_to(self.label2, self.entry1, Gtk.PositionType.BOTTOM, 3, 1)
self.attach_next_to(self.entry2, self.label2, Gtk.PositionType.BOTTOM, 3, 1)
self.attach_next_to(button, self.entry1, Gtk.PositionType.RIGHT, 3, 1)
self.attach_next_to(sep, self.entry1, Gtk.PositionType.BOTTOM, 3, 1)
self.attach_next_to(self.label2, sep, Gtk.PositionType.BOTTOM, 3, 1)
self.attach_next_to(self.fav, self.label2, Gtk.PositionType.BOTTOM, 3, 1)
self.attach_next_to(self.edit, self.fav, Gtk.PositionType.RIGHT, 3, 1)
self.attach_next_to(self.favbutton, self.edit, Gtk.PositionType.RIGHT, 3, 1)
+1 -1
View File
@@ -5,7 +5,7 @@ import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk # noqa E402
# TODO: abstract to support other icons
class WebButton(Gtk.Button):
def __init__(self, label: str):
super().__init__(label=label)