Merge pull request #538 from aclist/fix/clipboard-button-controller

fix: clipboard button controller
This commit is contained in:
aclist authored and GitHub committed 2026-11-11 03:32:27 +09:00
commit f5d7bf713d
2 files changed
+3 -5

No files matched your search

+1 -1
View File
@@ -109,7 +109,7 @@ class FilterManager:
for m in clean:
self.append_map([m])
def get_all_filters(self) -> tuple:
def get_all_filters(self) -> tuple[str, ...]:
map_name = self.get_active_map_name()
enabled = self.get_filters()
kw = self.get_active_keyword()
+2 -4
View File
@@ -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.strings import buttons
@@ -12,7 +12,6 @@ from dzgui.const.icons import (
ICON_LIST_ADD,
ICON_REFRESH,
ICON_STEAM,
ICON_WARNING,
ICON_WEB_BROWSER,
)
from dzgui.strings import connect_panel
@@ -99,9 +98,8 @@ class LargeIconTextButton(IconButton):
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)
self.controller = controller
self.connect("clicked", self._on_button_clicked, func)
self.set_tooltip_text(buttons.clipboard_button)