[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [PATCH] Fix loading 22x22 icons with KIconLoader
From:       Ingo =?iso-8859-15?q?Kl=F6cker?= <kloecker () kde ! org>
Date:       2003-10-25 17:31:59
[Download RAW message or body]

Hi,

the attached patch should fix the problem with the icons in the system 
tray. For example klipper and ksirc both have a 22x22 icon. But the 
iconloader loads the small 16x16 icons and then scales them to 22x22 
which gives them a blurry look (cf. Eva's message "Am I the only one 
who thinks this is ugly?").

Regards,
Ingo

["kiconloader.diff" (text/x-diff)]

Index: kiconloader.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kiconloader.cpp,v
retrieving revision 1.213
diff -u -3 -p -b -r1.213 kiconloader.cpp
--- kiconloader.cpp	18 Sep 2003 03:15:43 -0000	1.213
+++ kiconloader.cpp	25 Oct 2003 16:51:40 -0000
@@ -572,14 +572,16 @@ QPixmap KIconLoader::loadIcon(const QStr
 	if (inCache && (path_store == 0L))
 	    return pix;
 
+        int desiredSizeOrGroup = ( size != 0 ) ? -size : KIcon::User;
 	QString path = (absolutePath) ? name :
-			iconPath(name, KIcon::User, canReturnNull);
+			iconPath(name, desiredSizeOrGroup, canReturnNull);
 	if (path.isEmpty())
 	{
 	    if (canReturnNull)
 		return pix;
-	    // We don't know the desired size: use small
-	    path = iconPath(str_unknown, KIcon::Small, true);
+	    // Use small if we don't know the desired size.
+            desiredSizeOrGroup = ( size != 0 ) ? -size : KIcon::Small;
+	    path = iconPath(str_unknown, desiredSizeOrGroup, true);
 	    if (path.isEmpty())
 	    {
 		kdDebug(264) << "Warning: Cannot find \"unknown\" icon." << endl;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic