Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
deeffest authored Apr 10, 2024
1 parent 38bd5c7 commit a3e24c0
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 18 deletions.
4 changes: 2 additions & 2 deletions core/_init_config.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from PyQt5.QtCore import QByteArray

def _init_config(self):
if self.settings.value("app_theme") == "dark":
if self.settings.value("app_theme", "dark") == "dark":
self.actionDark_Theme.setChecked(True)
else:
self.actionDark_Theme.setChecked(False)

self.restoreState(self.settings.value('window_state', QByteArray()))
self.restoreState(self.settings.value('window_state', QByteArray()))
1 change: 1 addition & 0 deletions core/_init_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
def _init_connect(self):
self.actionOpen_Image.triggered.connect(self.open_file_dialog)
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.actionPrevious.triggered.connect(self.previous)
self.toolButton.clicked.connect(self.previous)
Expand Down
10 changes: 8 additions & 2 deletions core/_init_icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@
def _init_icons(self):
icons = {
"toolButton": {
"normal": f'{self.current_dir}/resources/icons/{self.settings.value("app_theme")}/arrow_back_ios.svg',
"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")}/arrow_forward_ios.svg',
"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,
},
}

for action_name, icon_paths in icons.items():
Expand Down
8 changes: 5 additions & 3 deletions core/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from PyQt5.QtWidgets import qApp, QMainWindow, QFileDialog, QMessageBox, \
QListWidgetItem
from PyQt5.QtGui import QIcon, QColor, QPixmap, QImage, QPalette
from PyQt5.QtCore import Qt, QSize, QEvent
from PyQt5.QtGui import QIcon, QPixmap, QImage
from PyQt5.QtCore import Qt, QEvent
from PyQt5 import uic

from core._init_attributes import _init_attributes
Expand Down Expand Up @@ -129,7 +129,7 @@ def select_current_image(self):
current_image = os.path.basename(self.image_path)
items = self.listWidget.findItems(current_image, Qt.MatchExactly)
for i in range(self.listWidget.count()):
self.listWidget.item(i).setForeground(Qt.white if self.settings.value("app_theme") == "dark" else Qt.black)
self.listWidget.item(i).setForeground(Qt.white if self.settings.value("app_theme", "dark") == "dark" else Qt.black)

if items:
item = items[0]
Expand Down Expand Up @@ -177,11 +177,13 @@ def full_screen(self):
self.statusbar.show()
self.showNormal()
self.actionFull_Screen.setChecked(False)
self.toolButton_3.setChecked(False)
else:
self.menubar.hide()
self.statusbar.hide()
self.setWindowState(Qt.WindowFullScreen)
self.actionFull_Screen.setChecked(True)
self.toolButton_3.setChecked(True)

def check_for_updates(self):
try:
Expand Down
45 changes: 38 additions & 7 deletions core/ui/main_window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<set>QDockWidget::AllDockWidgetFeatures</set>
</property>
<property name="windowTitle">
<string>Folder Contents</string>
<string>Control Panel</string>
</property>
<attribute name="dockWidgetArea">
<number>2</number>
Expand Down Expand Up @@ -215,6 +215,37 @@
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButton_3">
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="toolTip">
<string>Full Screen</string>
</property>
<property name="statusTip">
<string>Switches the full screen mode.</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
Expand All @@ -225,7 +256,7 @@
<string>Open Image...</string>
</property>
<property name="statusTip">
<string>After selecting the desired image, displays it in the app.</string>
<string>Opens the file (image) selection dialog box.</string>
</property>
<property name="shortcut">
<string>Ctrl+O</string>
Expand All @@ -239,7 +270,7 @@
<string>About...</string>
</property>
<property name="statusTip">
<string>Provides some information about this app.</string>
<string>Opens a dialog box with information about the app.</string>
</property>
</action>
<action name="actionFull_Screen">
Expand All @@ -250,7 +281,7 @@
<string>Full Screen</string>
</property>
<property name="statusTip">
<string>Opens the app in full screen mode.</string>
<string>Switches the full screen mode.</string>
</property>
<property name="shortcut">
<string>F11</string>
Expand Down Expand Up @@ -331,7 +362,7 @@
<string>About Qt</string>
</property>
<property name="statusTip">
<string>Provides some information about the framework used to create this app interface.</string>
<string>Opens a dialog box with information about the framework used to create this app's GUI.</string>
</property>
</action>
<action name="actionExit">
Expand All @@ -347,7 +378,7 @@
<string>Check for Updates</string>
</property>
<property name="statusTip">
<string>Checks if new versions of the app are publicly available.</string>
<string>Checks the Github repository for new versions of the app.</string>
</property>
</action>
<action name="actionDark_Theme">
Expand All @@ -358,7 +389,7 @@
<string>Dark Theme</string>
</property>
<property name="statusTip">
<string>Includes a dark app theme (requires a reboot to apply).</string>
<string>Switches the current app theme to dark (reboot required).</string>
</property>
</action>
</widget>
Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from core.main_window import MainWindow

name = "DEEF Lite Image Viewer"
version = "2.0.1"
version = "2.0.2"
current_dir = os.path.dirname(os.path.abspath(__file__))

def set_app_palette():
Expand Down Expand Up @@ -39,7 +39,7 @@ def set_app_palette():

if __name__ == '__main__':
settings = QSettings("deeffest", name)
app_theme = settings.value("app_theme")
app_theme = settings.value("app_theme", "dark")

app = QApplication(sys.argv + (['-platform', 'windows:darkmode=1'] if app_theme == "dark" else []))
app.setStyle("Fusion")
Expand Down
4 changes: 2 additions & 2 deletions notes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Update 2.0.1!
- Styles to components such as QToolTip, QMenuBar and QStatusBar have been added to the app.
Update 2.0.2!
- Fixed bugs related to app theme settings.
- Other fixes and improvements.
1 change: 1 addition & 0 deletions resources/icons/dark/close_fullscreen.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icons/dark/open_in_full.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icons/light/close_fullscreen.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icons/light/open_in_full.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a3e24c0

Please sign in to comment.