diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-06-23 02:17:48 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-06-23 02:18:48 -0500 |
commit | 5f8b00b9567d41d1f4681e2240528b9fce2d7b3b (patch) | |
tree | 507cae4a17c331c56aeaf5e9ef2978c13064af9b /kmail | |
parent | c830701a444a8f4f1ce8ce55fa7c1aff083ee5cc (diff) | |
download | tdepim-5f8b00b9567d41d1f4681e2240528b9fce2d7b3b.tar.gz tdepim-5f8b00b9567d41d1f4681e2240528b9fce2d7b3b.zip |
Use the largest possible font for the unread display in kmail and akregator if the tray icon size is less than 22 pixels
This resolves Bug 1251
Diffstat (limited to 'kmail')
-rw-r--r-- | kmail/kmsystemtray.cpp | 14 | ||||
-rw-r--r-- | kmail/kmsystemtray.h | 1 |
2 files changed, 14 insertions, 1 deletions
diff --git a/kmail/kmsystemtray.cpp b/kmail/kmsystemtray.cpp index 7cb2fb432..dc5cd04fb 100644 --- a/kmail/kmsystemtray.cpp +++ b/kmail/kmsystemtray.cpp @@ -133,7 +133,6 @@ void KMSystemTray::buildPopupMenu() action->plug( mPopupMenu ); mPopupMenu->insertSeparator(); - TDEMainWindow *mainWin = ::tqqt_cast<TDEMainWindow*>(kmkernel->getKMMainWidget()->topLevelWidget()); mPopupMenu->insertItem( SmallIcon("exit"), i18n("&Quit"), this, TQT_SLOT(maybeQuit()) ); } @@ -180,6 +179,11 @@ int KMSystemTray::mode() const return mMode; } +void KMSystemTray::resizeEvent(TQResizeEvent *) +{ + updateCount(); +} + /** * Update the count of unread messages. If there are unread messages, * overlay the count on top of a transparent version of the KMail icon. @@ -196,6 +200,14 @@ void KMSystemTray::updateCount() TQFont countFont = TDEGlobalSettings::generalFont(); countFont.setBold(true); + // increase the size of the font for the number of unread messages if the + // icon size is less than 22 pixels + // see bug 1251 + int realIconHeight = height(); + if (realIconHeight < 22) { + countFont.setPointSizeFloat( countFont.pointSizeFloat() * 2.0 ); + } + // decrease the size of the font for the number of unread messages if the // number doesn't fit into the available space float countFontSize = countFont.pointSizeFloat(); diff --git a/kmail/kmsystemtray.h b/kmail/kmsystemtray.h index c63fdd1df..b689def57 100644 --- a/kmail/kmsystemtray.h +++ b/kmail/kmsystemtray.h @@ -69,6 +69,7 @@ protected: void showKMail(); void buildPopupMenu(); void updateCount(); + void resizeEvent(TQResizeEvent *); TQString prettyName(KMFolder *); |