Hi,

the systray icons indicating offline and away status are currently still the ones from KDE 3.5. Attached is a patch that automatically generates icons for offline and away status from the current icon theme. The "all away" and "some away" status are merged (I don't think the distinction makes much sense anyway). See [1] for a visual diff.

I hope artwork changes like that are ok despite the feature freeze. Please review/comment :)

Dennis

[1] http://dev.gentoo.org/~earthwings/misc/kopete_icons/

diff --git a/kopete/kopete/systemtray.cpp b/kopete/kopete/systemtray.cpp
index a39c508..708b94b 100644
--- a/kopete/kopete/systemtray.cpp
+++ b/kopete/kopete/systemtray.cpp
@@ -25,6 +25,7 @@
 #include <QMouseEvent>
 #include <QPixmap>
 #include <QEvent>
+#include <QPainter>
 
 #include <kaboutdata.h>
 #include <kactioncollection.h>
@@ -33,6 +34,7 @@
 #include <klocale.h>	
 #include <kdebug.h>
 #include <kiconloader.h>
+#include <kiconeffect.h>
 #include "kopeteuiglobal.h"
 #include "kopetechatsessionmanager.h"
 #include "kopetebehaviorsettings.h"
@@ -267,22 +269,25 @@ void KopeteSystemTray::slotReevaluateAccountStates()
 
 	if (bAway)
 	{
-		if (!bOnline && !bOffline) // none online and none offline -> all away
-			setIcon(loadIcon("kopete_all_away"));
-		else
-			setIcon(loadIcon("kopete_some_away"));
+		QPixmap statusOverlay = loadIcon("user-away").pixmap(11,11);
+		QPixmap statusIcon = mKopeteIcon.pixmap(22,22);
+		if (!statusIcon.isNull() && !statusOverlay.isNull())
+		{
+			QPainter painter(&statusIcon);
+			painter.drawPixmap(QPoint(11,11), statusOverlay);
+		}
+		setIcon( statusIcon );
 	}
 	else if(bOnline)
 	{
-		/*if(bOffline) // at least one offline and at least one online -> some accounts online
-			setIcon(loadIcon("kopete_some_online"));
-		else*/ // none offline and none away -> all online
-			setIcon(mKopeteIcon);
+		setIcon(mKopeteIcon);
 	}
 	else // none away and none online -> all offline
 	{
 		//kDebug(14010) << "All Accounts offline!";
-		setIcon(loadIcon("kopete_offline"));
+		QImage offlineIcon = mKopeteIcon.pixmap(22,22).toImage();
+		KIconEffect::toGray( offlineIcon, 0.85 );
+		setIcon( QPixmap::fromImage( offlineIcon ) );
 	}
 }
 
_______________________________________________
kopete-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to