diff options
author | 2022-08-31 21:48:46 +0530 | |
---|---|---|
committer | 2022-08-31 21:55:27 +0530 | |
commit | 530c24bf2bf672845d4d4f7c17f69ce213b7cf1d (patch) | |
tree | 6124bcf70c6dbef30c9e01c3714cd6c050581c42 /src/mainwindow.h | |
parent | 997ae821abb7985f3a78e4debfe0415fe2a86b6f (diff) | |
download | whatsie-530c24bf2bf672845d4d4f7c17f69ce213b7cf1d.tar.gz whatsie-530c24bf2bf672845d4d4f7c17f69ce213b7cf1d.zip |
feat: systemtray notification counter
other changes include:
- no client side check on new chat numbers, whatsapp web doing check
Diffstat (limited to 'src/mainwindow.h')
-rw-r--r-- | src/mainwindow.h | 10 |
1 files changed, 6 insertions, 4 deletions
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(); |