add tray unread icon setting

This commit is contained in:
dries.k
2022-11-03 17:42:22 +01:00
parent 5c01fcc747
commit 79370bc232
5 changed files with 95 additions and 72 deletions

View File

@@ -267,7 +267,10 @@ class MainApplication(QtWidgets.QApplication):
self.add_message_to_model(message)
# Change the tray icon to show there are unread notifications
if not self.main_window.isActiveWindow():
if (
settings.value("tray/icon/unread", type=bool)
and not self.main_window.isActiveWindow()
):
self.tray.set_icon_unread()
# Show a notification
@@ -340,7 +343,9 @@ class MainApplication(QtWidgets.QApplication):
def settings_callback(self):
settings_dialog = SettingsDialog()
settings_dialog.quit_requested.connect(self.quit)
settings_dialog.theme_change_requested.connect(lambda theme: set_theme(self, theme))
settings_dialog.theme_change_requested.connect(
lambda theme: set_theme(self, theme)
)
accepted = settings_dialog.exec()
if accepted and settings_dialog.settings_changed: