From 5f8b00b9567d41d1f4681e2240528b9fce2d7b3b Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 23 Jun 2013 02:17:48 -0500 Subject: 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 --- kmail/kmsystemtray.cpp | 14 +++++++++++++- kmail/kmsystemtray.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'kmail') diff --git a/kmail/kmsystemtray.cpp b/kmail/kmsystemtray.cpp index 7cb2fb43..dc5cd04f 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(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 c63fdd1d..b689def5 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 *); -- cgit v1.2.3