change the tray icon to show there are unread notifications

This commit is contained in:
dries.k
2022-11-02 20:19:02 +01:00
parent a8a854ce6b
commit ac15d079ef
5 changed files with 25 additions and 0 deletions

View File

@@ -266,6 +266,10 @@ class MainApplication(QtWidgets.QApplication):
def new_message_callback(self, message: gotify.GotifyMessageModel):
self.add_message_to_model(message)
# Change the tray icon to show there are unread notifications
if not self.main_window.isActiveWindow():
self.tray.set_icon_unread()
# Show a notification
if (
message.priority < settings.value("tray/notifications/priority", type=int)
@@ -385,6 +389,7 @@ class MainApplication(QtWidgets.QApplication):
self.main_window.delete_message.connect(self.delete_message_callback)
self.main_window.image_popup.connect(self.image_popup_callback)
self.main_window.hidden.connect(self.main_window_hidden_callback)
self.main_window.activated.connect(self.tray.revert_icon)
self.watchdog.closed.connect(lambda: self.listener_closed_callback(None, None))