Version: 2.1.0 (using KDE 4.7.0) OS: Linux Kmail2 now uses KStatusNotifierItem for the tray icon, which means the icon is plasma themable by adding a kmail.svg(z) file in a plasma theme. The svg icon works fine, but the unread email overlays don't show on the icon when using a svg icon, probably because of the way the overlay is drawn in kmsystemtray.cpp: [quote] // Paint the number in a pixmap QPixmap overlayPixmap( overlaySize, overlaySize ); overlayPixmap.fill( Qt::transparent ); QPainter p( &overlayPixmap ); p.setFont( countFont ); KColorScheme scheme( QPalette::Active, KColorScheme::View ); p.setBrush( Qt::NoBrush ); p.setPen( scheme.foreground( KColorScheme::LinkText ).color() ); p.setOpacity( 1.0 ); p.drawText( overlayPixmap.rect(), Qt::AlignCenter, countString ); p.end(); QPixmap iconPixmap = mIcon.pixmap(overlaySize, overlaySize); QPainter pp(&iconPixmap); pp.drawPixmap(0, 0, overlayPixmap); pp.end(); setIconByPixmap( iconPixmap ); [/quote] Because of this, a user cannot tell whether there is new mail by looking at the tray icon. Possible ways to fix: 1. draw the message count overlay in an plasma theme (svg) friendly way, if possible, or 2. use a different icon (mail-unread-new, for example) when there is new mail. This won't show the email counts either, but provides visual feedback for the user when there are new mails. Reproducible: Always Steps to Reproduce: 1. Create a valid plasma themed kmail.svg icon in your plasma themes icon folder. 2. Configure kmail to always show the tray icon 3. Restart plasma and kmail if necessary to show the new icon 4. Wait for new mail Actual Results: New message count is not shown on the tray icon. Expected Results: Message count is shown on the icon when there are new mails. The above is also true for akregator's icon (when using a plasma themed svg), I can report a new bug report for akregator if requested. If you need more information, I'd be happy to provide it. Thanks for your time.
currently theming system tray icons with SVGs and application custom-painting are mutually exclusive. for now, i recommend not using a themed svg for kmail if you wish to see the count. (that customization combined with the status removing "always show this icon" modification makes this already seem a bit fishy: the user has carefully removed all means of status change notification. :) we may in future support something along the lines of (limited) custom overlays (such as counts) to status notifiers.
Thanks for a quick response. Yes, this more of a minor nuisance (not many plasma themes include kmail/akregator icons), with a number of workarounds available (like using a customized regular png icon for theming). The use case for "always show icon" is that this is the only way (that I know of) to keep kmail loaded and running in the background when closing it's window, so it would be nice to have some new message feedback even with an svg icon (even if message counts are off the table at this point). For example, kopete handles svg icon files nicely by switching "kopete" and "kopete-offline" icons when necessary (and can even load the small status overlays over the svgs).
The simplest way to "solve" the problem could be just switching the icon when there's new mail (diff below): 74c74 < mIcon = KIcon( "kmail" ); --- > mIcon = KIcon( "mail-unread-new" ); 184a185 > setIconByName( "mail-unread-new" ); Of course this could be configurable in a similar way that user's can choose their own icons for mail folders. And a few more changes would be required to reflect the new mail status in the tray icon tooltip as well.
Another option could be toggling the active/passive mode in the StatusNotifierItem based on whether there is mail or not. (That seems to be the tendency in StatusNotifierItems, go active when there is something noteworthy and remain passive [hidden] otherwise). This shouldn't be a problem for those that wish to have the icon always shown, as "always show icon" can be forced in the notification tray settings.
Git commit 487cace7ac63c51e89585475a808abcdf5ff86ae by Montel Laurent. Committed on 30/03/2012 at 13:29. Pushed by mlaurent into branch 'master'. Change icon when we have unread emails M +3 -1 kmail/kmsystemtray.cpp http://commits.kde.org/kdepim/487cace7ac63c51e89585475a808abcdf5ff86ae
Git commit 9d579cdb3ea4765f373563f00648d9577473edf2 by Montel Laurent. Committed on 30/03/2012 at 13:29. Pushed by mlaurent into branch 'KDE/4.8'. Change icon when we have unread emails (cherry picked from commit 487cace7ac63c51e89585475a808abcdf5ff86ae) M +3 -1 kmail/kmsystemtray.cpp http://commits.kde.org/kdepim/9d579cdb3ea4765f373563f00648d9577473edf2
Much appreciated... Looking forward to the change in 4.9 and 4.8.3 (If I've understood the commits correctly?)
yes in 4.8.2/4.9
I'm not sure how to interpret this correctly. It's still unconfirmed, and it does not work, but according to messages it is supposed to be fixed?
The issue is still present using kde 4.10 beta1
still the case in latest kmail: 15.12.2-1
*** This bug has been marked as a duplicate of bug 377521 ***