diff options
| author | Robert Honz <exislow+github@gmail.com> | 2024-01-19 11:06:38 +0100 |
|---|---|---|
| committer | Robert Honz <exislow+github@gmail.com> | 2024-01-19 11:06:38 +0100 |
| commit | d39bcc9292590639b1f61035c9386c4550a198d7 (patch) | |
| tree | 245d4c0a7aafd41464bd900231b319c3a11d6026 /tidal_dl_ng/gui.py | |
| parent | 6cf723b2b8ec824c25c6a46de50215797518ea14 (diff) | |
| download | tidal-dl-ng-d39bcc9292590639b1f61035c9386c4550a198d7.tar.gz | |
✨ Window icon will be shown. App will be built with specific icons per OS.
Diffstat (limited to 'tidal_dl_ng/gui.py')
| -rw-r--r-- | tidal_dl_ng/gui.py | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/tidal_dl_ng/gui.py b/tidal_dl_ng/gui.py index 5a2501a..810672a 100644 --- a/tidal_dl_ng/gui.py +++ b/tidal_dl_ng/gui.py @@ -30,7 +30,6 @@ from tidal_dl_ng.worker import Worker # TODO: Make more use of Exceptions -# TODO: Add File -> Version class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): settings: Settings = None tidal: Tidal = None @@ -56,7 +55,6 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): self.setupUi(self) # self.setGeometry(50, 50, 500, 300) self.setWindowTitle("TIDAL Downloader Next Gen!") - self._init_tray() # Logging redirect. XStream.stdout().messageWritten.connect(self._log_output) @@ -473,24 +471,20 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): def on_version(self) -> None: DialogVersion(self) - def _init_tray(self): - # TODO: Fix icons (make them visible). - # my_pixmap = QtGui.QPixmap("tidal_dl_ng/ui/icon.png") - my_icon = QtGui.QIcon("tidal_dl_ng/ui/icon.png") - # self.setWindowIcon(my_icon) - self.tray = QtWidgets.QSystemTrayIcon() - self.tray.setIcon(my_icon) - self.tray.setVisible(True) - self.tray.setContextMenu(self.m_file) - # TODO: Comment with Google Docstrings. def gui_activate(tidal: Tidal | None = None): + # Set dark theme and create QT app. qdarktheme.enable_hi_dpi() app = QtWidgets.QApplication(sys.argv) qdarktheme.setup_theme() - window = MainWindow(tidal) + # Create icon object and apply it to app window. + pixmap: QtGui.QPixmap = QtGui.QPixmap("tidal_dl_ng/ui/icon.png") + icon: QtGui.QIcon = QtGui.QIcon(pixmap) + app.setWindowIcon(icon) + + window = MainWindow(tidal=tidal) window.show() sys.exit(app.exec()) |
