mirror of
https://github.com/aclist/dztui.git
synced 2026-11-11 20:40:38 +01:00
feat: ExceptionDialog WIP
This commit is contained in:
1 parent
59ef15073f
commit
45bd0e16ec
7 files changed
+122
-31
No files matched your search
@@ -1,3 +1,5 @@
|
||||
from typing import Callable, Self, TYPE_CHECKING
|
||||
|
||||
from dzgui.util.strings import refresh, connect_panel
|
||||
from dzgui.const.constants import (
|
||||
CLIPBOARD,
|
||||
@@ -12,6 +14,9 @@ import gi
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk # noqa E402
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from dzgui.controllers.mc import Controller
|
||||
|
||||
|
||||
class Icon(Gtk.Image):
|
||||
def __init__(self, name: str, l_margin=0) -> None:
|
||||
@@ -52,8 +57,13 @@ class LargeIconTextButton(IconButton):
|
||||
|
||||
|
||||
class ClipboardButton(IconButton):
|
||||
def __init__(self) -> None:
|
||||
def __init__(self, controller: "Controller", data: str) -> None:
|
||||
super().__init__(CLIPBOARD)
|
||||
self.controller = controller
|
||||
self.connect("clicked", self._on_button_clicked, data)
|
||||
|
||||
def _on_button_clicked(self, button: Self, data: str) -> None:
|
||||
self.controller.copy_clipboard(data)
|
||||
|
||||
|
||||
class WebButton(IconTextButton):
|
||||
|
||||
Reference in new issue
Block a user