From 01cc12fede5462c788a8fd022ae95701b08e104e Mon Sep 17 00:00:00 2001 From: Integral Date: Sun, 7 Jul 2024 23:28:36 +0800 Subject: [PATCH] Add number of unread messages to tray icon toolIip --- src/TrayIcon.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/TrayIcon.cpp b/src/TrayIcon.cpp index c62fecea..776140f2 100644 --- a/src/TrayIcon.cpp +++ b/src/TrayIcon.cpp @@ -129,6 +129,13 @@ TrayIcon::setUnreadCount(int count) previousCount = count; } #endif + + QString toolTip = QLatin1String("nheko"); + if (count > 0) { + toolTip.append(tr("\n%1 unread message(s)").arg(count)); + } + + setToolTip(toolTip); } #include "moc_TrayIcon.cpp"