Skip to content

Commit

Permalink
replaced QAction with qfluentwidgets Action
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonzorn committed Apr 13, 2024
1 parent 983d121 commit 527fb75
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
7 changes: 3 additions & 4 deletions nlightreader/contexts/HistoryNote.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from PySide6.QtGui import QAction
from qfluentwidgets import RoundMenu, FluentIcon
from qfluentwidgets import RoundMenu, FluentIcon, Action

from nlightreader.utils import translate


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):
"""
Expand Down
13 changes: 6 additions & 7 deletions nlightreader/contexts/LibraryManga.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
from PySide6.QtGui import QAction
from qfluentwidgets import RoundMenu, FluentIcon
from qfluentwidgets import RoundMenu, FluentIcon, Action

from nlightreader.utils import translate


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):
"""
Expand Down
9 changes: 4 additions & 5 deletions nlightreader/contexts/ReadMark.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from PySide6.QtGui import QAction
from qfluentwidgets import RoundMenu, FluentIcon
from qfluentwidgets import RoundMenu, FluentIcon, Action

from nlightreader.utils import translate


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):
"""
Expand Down

0 comments on commit 527fb75

Please sign in to comment.