-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
827 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,30 @@ | ||
import sys | ||
|
||
from PyQt5.QtWidgets import qApp | ||
from PyQt5.QtGui import QStatusTipEvent | ||
from PyQt5.QtCore import QObject, QEvent | ||
|
||
class StatusTipFilter(QObject): | ||
def eventFilter(self, watched: QObject, event: QEvent) -> bool: | ||
if isinstance(event, QStatusTipEvent): | ||
return True | ||
return super().eventFilter(watched, event) | ||
|
||
def _init_connect(self): | ||
self.actionOpen_Image.triggered.connect(self.open_file_dialog) | ||
self.actionExit_2.triggered.connect(self.exit_app) | ||
self.folder_contents_widget.lineEdit.textChanged.connect(self.filter_list_items) | ||
self.actionFull_Screen.triggered.connect(self.full_screen) | ||
self.toolButton_3.clicked.connect(self.full_screen) | ||
self.actionDark_Theme.triggered.connect(self.toggle_dark_theme) | ||
self.actionSlide_Show.triggered.connect(self.slide_show) | ||
self.actionZoom_In.triggered.connect(self.zoom_in) | ||
self.actionZoom_Out.triggered.connect(self.zoom_out) | ||
self.actionRotate.triggered.connect(self.rotate_image) | ||
self.actionSet_as_Wallpaper.triggered.connect(self.set_wallpaper) | ||
self.actionSettings.triggered.connect(self.open_settings) | ||
self.actionPrevious.triggered.connect(self.previous) | ||
self.toolButton.clicked.connect(self.previous) | ||
self.actionNext.triggered.connect(self.next) | ||
self.toolButton_2.clicked.connect(self.next) | ||
self.actionCheck_Updates.triggered.connect(self.check_for_updates) | ||
self.actionAbout.triggered.connect(self.about) | ||
self.actionAbout_Qt.triggered.connect(lambda: qApp.aboutQt()) | ||
|
||
self.image_viewer.customContextMenuRequested.connect(self.show_context_menu) | ||
self.scrollArea.installEventFilter(self) | ||
self.image_viewer.installEventFilter(self) | ||
self.installEventFilter(StatusTipFilter(self)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,33 @@ | ||
from PyQt5.QtWidgets import QAction, QSizePolicy, QWidget | ||
from PyQt5.QtGui import QIcon | ||
from PyQt5.QtWidgets import QWidget, QSizePolicy, QLabel | ||
|
||
def _init_content(self): | ||
self.zoom_label = QLabel(self) | ||
self.statusbar.addPermanentWidget(self.zoom_label) | ||
|
||
self.create_folder_contents_menu() | ||
self.actionFolder_Contents_3.setVisible(False) | ||
|
||
self.toolBar.addAction(self.actionOpen_Image) | ||
self.toolBar.addSeparator() | ||
|
||
self.toolBar.addAction(self.actionPrevious) | ||
self.toolBar.addAction(self.actionNext) | ||
self.toolBar.addSeparator() | ||
|
||
self.toolBar.addAction(self.actionZoom_In) | ||
self.toolBar.addAction(self.actionZoom_Out) | ||
self.toolBar.addAction(self.actionRotate) | ||
self.toolBar.addSeparator() | ||
|
||
spacer = QWidget() | ||
spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) | ||
self.toolBar.addWidget(spacer) | ||
|
||
self.toolBar.addAction(self.actionSlide_Show) | ||
self.toolBar.addSeparator() | ||
self.toolBar.addAction(self.actionFull_Screen) | ||
|
||
self.set_timer() | ||
|
||
if self.image_path: | ||
self.open_image(self.image_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,21 @@ | ||
from PyQt5.QtGui import QIcon, QPixmap | ||
|
||
def _init_icons(self): | ||
icons = { | ||
"toolButton": { | ||
"normal": f'{self.current_dir}/resources/icons/{self.settings.value("app_theme", "dark")}/arrow_back_ios.svg', | ||
"normal_off": None, | ||
"disabled": f'{self.current_dir}/resources/icons/disabled/arrow_back_ios.svg', | ||
"disabled_off": None, | ||
}, | ||
"toolButton_2": { | ||
"normal": f'{self.current_dir}/resources/icons/{self.settings.value("app_theme", "dark")}/arrow_forward_ios.svg', | ||
"normal_off": None, | ||
"disabled": f'{self.current_dir}/resources/icons/disabled/arrow_forward_ios.svg', | ||
"disabled_off": None, | ||
}, | ||
"toolButton_3": { | ||
"normal": f'{self.current_dir}/resources/icons/{self.settings.value("app_theme", "dark")}/open_in_full.svg', | ||
"normal_off": f'{self.current_dir}/resources/icons/{self.settings.value("app_theme", "dark")}/close_fullscreen.svg', | ||
"disabled": None, | ||
"disabled_off": None, | ||
}, | ||
} | ||
import qtawesome as qta | ||
|
||
for action_name, icon_paths in icons.items(): | ||
action = getattr(self, action_name, None) | ||
if action: | ||
icon = QIcon() | ||
if icon_paths.get("normal"): | ||
icon.addPixmap(QPixmap(icon_paths["normal"]), QIcon.Normal, QIcon.Off) | ||
if icon_paths.get("normal_off"): | ||
icon.addPixmap(QPixmap(icon_paths["normal_off"]), QIcon.Normal, QIcon.On) | ||
if icon_paths.get("disabled"): | ||
icon.addPixmap(QPixmap(icon_paths["disabled"]), QIcon.Disabled, QIcon.Off) | ||
if icon_paths.get("disabled_off"): | ||
icon.addPixmap(QPixmap(icon_paths["disabled_off"]), QIcon.Disabled, QIcon.On) | ||
action.setIcon(icon) | ||
else: | ||
print(f"Action {action_name} not found in the Window class.") | ||
def _init_icons(self): | ||
self.actionOpen_Image.setIcon(qta.icon('ei.file-new')) | ||
self.actionExit_2.setIcon(qta.icon('fa.close')) | ||
self.actionFull_Screen.setIcon(qta.icon('ei.resize-full')) | ||
self.actionSlide_Show.setIcon(qta.icon('ri.slideshow-2-line')) | ||
self.actionZoom_In.setIcon(qta.icon('ei.zoom-in')) | ||
self.actionZoom_Out.setIcon(qta.icon('ei.zoom-out')) | ||
self.actionRotate.setIcon(qta.icon('fa.rotate-left')) | ||
self.menuSet_As.setIcon(qta.icon('mdi.image-move')) | ||
self.actionSet_as_Wallpaper.setIcon(qta.icon('mdi.wallpaper')) | ||
self.actionSettings.setIcon(qta.icon('ri.settings-4-fill')) | ||
self.actionPrevious.setIcon(qta.icon('ei.chevron-left')) | ||
self.actionNext.setIcon(qta.icon('ei.chevron-right')) | ||
self.menuFolder_Contents.setIcon(qta.icon('ei.folder-open')) | ||
self.actionCheck_Updates.setIcon(qta.icon('ei.search')) | ||
self.actionAbout.setIcon(qta.icon('ei.info-circle')) | ||
self.actionAbout_Qt.setIcon(QIcon(f'{self.current_dir}/resources/icons/qt.png')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.