From 530c24bf2bf672845d4d4f7c17f69ce213b7cf1d Mon Sep 17 00:00:00 2001 From: Keshav Bhatt Date: Wed, 31 Aug 2022 21:48:46 +0530 Subject: feat: systemtray notification counter other changes include: - no client side check on new chat numbers, whatsapp web doing check --- src/mainwindow.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/mainwindow.h') diff --git a/src/mainwindow.h b/src/mainwindow.h index 76abe86..970458b 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -41,6 +41,7 @@ class MainWindow : public QMainWindow { public: explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); + public slots: void updateWindowTheme(); void updatePageTheme(); @@ -55,7 +56,8 @@ public slots: void alreadyRunning(bool notify = false); void notify(QString title, QString message); void toggleTheme(); - void doReload(bool byPassCache = false, bool isAskedByCLI = false, bool byLoadingQuirk = false); + void doReload(bool byPassCache = false, bool isAskedByCLI = false, + bool byLoadingQuirk = false); void newChat(); protected slots: void closeEvent(QCloseEvent *event) override; @@ -63,6 +65,7 @@ protected slots: void changeEvent(QEvent *e) override; private: + const QIcon getTrayIcon(const int ¬ificationCount) const; QPalette lightPalette, darkPalette; void createActions(); void createTrayIcon(); @@ -70,8 +73,8 @@ private: QSettings settings; QRegExp notificationsTitleRegExp; - QIcon trayIconRead; - QIcon trayIconUnread; + QIcon trayIconNormal; + QRegExp unreadMessageCountRegExp; QAction *reloadAction; QAction *minimizeAction; @@ -115,7 +118,6 @@ private slots: void checkLoadedCorrectly(); void loadingQuirk(QString test); void setNotificationPresenter(QWebEngineProfile *profile); - bool isPhoneNumber(const QString &phoneNumber); void quitApp(); void initRateWidget(); void initThemes(); -- cgit v1.2.3