From 527fb754bb6e2015abc62be612998b23fcd51b9a Mon Sep 17 00:00:00 2001 From: bzorn Date: Sat, 13 Apr 2024 12:39:19 +0300 Subject: [PATCH] replaced QAction with qfluentwidgets Action --- nlightreader/contexts/HistoryNote.py | 7 +++---- nlightreader/contexts/LibraryManga.py | 13 ++++++------- nlightreader/contexts/ReadMark.py | 9 ++++----- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/nlightreader/contexts/HistoryNote.py b/nlightreader/contexts/HistoryNote.py index 9fbc8e2e..2cb3b3a3 100644 --- a/nlightreader/contexts/HistoryNote.py +++ b/nlightreader/contexts/HistoryNote.py @@ -1,5 +1,4 @@ -from PySide6.QtGui import QAction -from qfluentwidgets import RoundMenu, FluentIcon +from qfluentwidgets import RoundMenu, FluentIcon, Action from nlightreader.utils import translate @@ -7,8 +6,8 @@ class HistoryNoteMenu(RoundMenu): def __init__(self): super().__init__() - self.set_as_read = QAction(FluentIcon.ACCEPT_MEDIUM.icon(), translate("Menu", "Mark as read")) - self.remove_all = QAction(FluentIcon.REMOVE.icon(), translate("Menu", "Remove all")) + self.set_as_read = Action(FluentIcon.ACCEPT_MEDIUM, translate("Menu", "Mark as read")) + self.remove_all = Action(FluentIcon.REMOVE, translate("Menu", "Remove all")) def set_mode(self, mode: int): """ diff --git a/nlightreader/contexts/LibraryManga.py b/nlightreader/contexts/LibraryManga.py index 5e285343..5eda3f32 100644 --- a/nlightreader/contexts/LibraryManga.py +++ b/nlightreader/contexts/LibraryManga.py @@ -1,5 +1,4 @@ -from PySide6.QtGui import QAction -from qfluentwidgets import RoundMenu, FluentIcon +from qfluentwidgets import RoundMenu, FluentIcon, Action from nlightreader.utils import translate @@ -7,11 +6,11 @@ class LibraryMangaMenu(RoundMenu): def __init__(self): super().__init__() - self.add_to_lib = QAction(FluentIcon.ADD_TO.icon(), translate("Menu", "Add to Library")) - self.remove_from_lib = QAction(FluentIcon.REMOVE_FROM.icon(), translate("Menu", "Remove from library")) - self.open_in_browser = QAction(FluentIcon.LINK.icon(), translate("Menu", "Open in browser")) - self.remove_files = QAction(FluentIcon.DELETE.icon(), translate("Menu", "Clear local files")) - self.open_local_files = QAction(FluentIcon.FOLDER.icon(), translate("Menu", "Open local files")) + self.add_to_lib = Action(FluentIcon.ADD_TO, translate("Menu", "Add to Library")) + self.remove_from_lib = Action(FluentIcon.REMOVE_FROM, translate("Menu", "Remove from library")) + self.open_in_browser = Action(FluentIcon.LINK, translate("Menu", "Open in browser")) + self.remove_files = Action(FluentIcon.DELETE, translate("Menu", "Clear local files")) + self.open_local_files = Action(FluentIcon.FOLDER, translate("Menu", "Open local files")) def set_mode(self, mode: int): """ diff --git a/nlightreader/contexts/ReadMark.py b/nlightreader/contexts/ReadMark.py index 7513638a..108fcc03 100644 --- a/nlightreader/contexts/ReadMark.py +++ b/nlightreader/contexts/ReadMark.py @@ -1,5 +1,4 @@ -from PySide6.QtGui import QAction -from qfluentwidgets import RoundMenu, FluentIcon +from qfluentwidgets import RoundMenu, FluentIcon, Action from nlightreader.utils import translate @@ -7,9 +6,9 @@ class ReadMarkMenu(RoundMenu): def __init__(self): super().__init__() - self.set_as_read = QAction(FluentIcon.ACCEPT_MEDIUM.icon(), translate("Menu", "Mark as read")) - self.set_as_read_all = QAction(FluentIcon.COMPLETED.icon(), translate("Menu", "Mark as read all previous")) - self.remove_read_state = QAction(FluentIcon.REMOVE.icon(), translate("Menu", "Remove read mark")) + self.set_as_read = Action(FluentIcon.ACCEPT_MEDIUM, translate("Menu", "Mark as read")) + self.set_as_read_all = Action(FluentIcon.COMPLETED, translate("Menu", "Mark as read all previous")) + self.remove_read_state = Action(FluentIcon.REMOVE, translate("Menu", "Remove read mark")) def set_mode(self, mode: int): """