mirror of
https://github.com/aclist/dztui.git
synced 2026-11-12 13:00:37 +01:00
Merge pull request #538 from aclist/fix/clipboard-button-controller
fix: clipboard button controller
This commit is contained in:
2 files changed
+3
-5
No files matched your search
@@ -109,7 +109,7 @@ class FilterManager:
|
|||||||
for m in clean:
|
for m in clean:
|
||||||
self.append_map([m])
|
self.append_map([m])
|
||||||
|
|
||||||
def get_all_filters(self) -> tuple:
|
def get_all_filters(self) -> tuple[str, ...]:
|
||||||
map_name = self.get_active_map_name()
|
map_name = self.get_active_map_name()
|
||||||
enabled = self.get_filters()
|
enabled = self.get_filters()
|
||||||
kw = self.get_active_keyword()
|
kw = self.get_active_keyword()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from typing import Callable, Literal, Self, TYPE_CHECKING
|
from typing import Callable, Literal, Self, TYPE_CHECKING, Union
|
||||||
|
|
||||||
from dzgui.util.clip import copy_clipboard
|
from dzgui.util.clip import copy_clipboard
|
||||||
from dzgui.strings import buttons
|
from dzgui.strings import buttons
|
||||||
@@ -12,7 +12,6 @@ from dzgui.const.icons import (
|
|||||||
ICON_LIST_ADD,
|
ICON_LIST_ADD,
|
||||||
ICON_REFRESH,
|
ICON_REFRESH,
|
||||||
ICON_STEAM,
|
ICON_STEAM,
|
||||||
ICON_WARNING,
|
|
||||||
ICON_WEB_BROWSER,
|
ICON_WEB_BROWSER,
|
||||||
)
|
)
|
||||||
from dzgui.strings import connect_panel
|
from dzgui.strings import connect_panel
|
||||||
@@ -99,9 +98,8 @@ class LargeIconTextButton(IconButton):
|
|||||||
|
|
||||||
|
|
||||||
class ClipboardButton(IconTextButton):
|
class ClipboardButton(IconTextButton):
|
||||||
def __init__(self, controller: Union["Controller", None], func: Callable) -> None:
|
def __init__(self, func: Callable[[], str]) -> None:
|
||||||
super().__init__(ICON_CLIPBOARD, atomic_buttons.copy)
|
super().__init__(ICON_CLIPBOARD, atomic_buttons.copy)
|
||||||
self.controller = controller
|
|
||||||
self.connect("clicked", self._on_button_clicked, func)
|
self.connect("clicked", self._on_button_clicked, func)
|
||||||
|
|
||||||
self.set_tooltip_text(buttons.clipboard_button)
|
self.set_tooltip_text(buttons.clipboard_button)
|
||||||
|
|||||||
Reference in new issue
Block a user