[kde-doc-english] [trojita] src/Gui: GUI: add a tooltip to the systray

Caspar Schutijser caspar at schutijser.com
Tue May 21 10:30:49 UTC 2013


Git commit 2afb1a63893eb7ce4768333e3e37eabe4e64a5bb by Caspar Schutijser.
Committed on 20/05/2013 at 20:51.
Pushed by jkt into branch 'master'.

GUI: add a tooltip to the systray

It shows the number of unread messages, if any.

M  +4    -0    src/Gui/Window.cpp

http://commits.kde.org/trojita/2afb1a63893eb7ce4768333e3e37eabe4e64a5bb

diff --git a/src/Gui/Window.cpp b/src/Gui/Window.cpp
index e5ae7fa..f830ef9 100644
--- a/src/Gui/Window.cpp
+++ b/src/Gui/Window.cpp
@@ -722,6 +722,7 @@ void MainWindow::createSysTray()
 
     m_trayIcon = new QSystemTrayIcon(this);
 
+    m_trayIcon->setToolTip(trUtf8("Trojitá"));
     m_trayIcon->setIcon(QIcon(QLatin1String(":/icons/trojita.png")));
 
     QAction* quitAction = new QAction(tr("&Quit"), m_trayIcon);
@@ -777,6 +778,9 @@ void MainWindow::handleTrayIconChange()
             painter.setFont(f);
             painter.setPen(Qt::blue);
             painter.drawText(pixmap.rect(), Qt::AlignCenter, mailbox.data(Imap::Mailbox::RoleUnreadMessageCount).toString());
+            m_trayIcon->setToolTip(trUtf8("Trojitá - %n unread message(s)", 0, mailbox.data(Imap::Mailbox::RoleUnreadMessageCount).toInt()));
+        } else {
+            m_trayIcon->setToolTip(trUtf8("Trojitá"));
         }
         m_trayIcon->setIcon(QIcon(pixmap));
     }



More information about the kde-doc-english mailing list