summary refs log tree commit diff
path: root/src/TrayIcon.h
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2024-06-20 21:35:55 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2024-06-20 21:35:55 +0200
commita486d8d7fc567c191e7259b478b6f03b3800ac4a (patch)
tree9f01f7bb80df5b2502d92d91fe1329209224289c /src/TrayIcon.h
parentFix QT_CONFIG check for wayland is only available since Qt6.7 (diff)
downloadnheko-a486d8d7fc567c191e7259b478b6f03b3800ac4a.tar.xz
Fix tray icon badge count not getting updated since 838b091acd07b681fc52f6f705b2bee8ce8519d5
Diffstat (limited to '')
-rw-r--r--src/TrayIcon.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/TrayIcon.h b/src/TrayIcon.h
index f2009612..7c0bc7b2 100644
--- a/src/TrayIcon.h
+++ b/src/TrayIcon.h
@@ -15,15 +15,11 @@ class QPainter;
 class MsgCountComposedIcon final : public QIconEngine
 {
 public:
-    MsgCountComposedIcon(const QString &filename);
+    MsgCountComposedIcon(const QIcon &icon);
 
     void paint(QPainter *p, const QRect &rect, QIcon::Mode mode, QIcon::State state) override;
     QIconEngine *clone() const override;
-    QList<QSize> availableSizes(QIcon::Mode mode, QIcon::State state)
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-      const
-#endif
-      override;
+    QList<QSize> availableSizes(QIcon::Mode mode, QIcon::State state) override;
     QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override;
 
     int msgCount = 0;
@@ -47,7 +43,6 @@ private:
     QAction *viewAction_;
     QAction *quitAction_;
 
-#if !defined(Q_OS_MACOS) && !defined(Q_OS_WIN)
-    MsgCountComposedIcon *icon_;
-#endif
+    int previousCount = 0;
+    QIcon icon;
 };