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

List:       kde-core-devel
Subject:    KDE/kdelibs/kdeui/icons
From:       Rafael Fernández López <ereslibre () kde ! org>
Date:       2007-10-16 18:47:16
Message-ID: 1192560436.281094.31133.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 725966 by ereslibre:

Revert this patch, I prefer to keep alive...

CCMAIL: pinheiro@kde.org
CCMAIL: riccardo@kde.org
CCMAIL: aseigo@kde.org
CCMAIL: kde-core-devel@kde.org


 M  +6 -53     kiconloader.cpp  
 M  +3 -2      kicontheme.cpp  


--- trunk/KDE/kdelibs/kdeui/icons/kiconloader.cpp #725965:725966
@@ -615,35 +615,9 @@
     const_cast<KIconLoaderPrivate*>(this)->initIconThemes();
 
     K3Icon icon;
+    const char * const ext[4] = { ".png", ".svgz", ".svg", ".xpm" };
 
-    const char * ext1[4] = { ".png", ".svgz", ".svg", ".xpm" };
-    const char * ext2[4] = { ".svgz", ".svg", ".png", ".xpm" };
-    const char ** ext;
-
-    if (size == KIconLoader::SizeSmall ||
-        size == KIconLoader::SizeSmallMedium ||
-        size == KIconLoader::SizeMedium ||
-        size == KIconLoader::SizeLarge ||
-        size == KIconLoader::SizeHuge ||
-        size == KIconLoader::SizeEnormous)
-    {
-        ext = ext1; // size is standard, give preference to PNG over SVG when searching
-    }
-    else
-    {
-        ext = ext2; // size is non-standard, give preference to SVG over PNG when searching
-    }
-
-    /* If size parameter is a standard one, that means:
-
-           - KIconLoader::SizeSmall
-           - KIconLoader::SizeSmallMedium
-           - KIconLoader::SizeMedium
-           - KIconLoader::SizeLarge
-           - KIconLoader::SizeHuge
-           - KIconLoader::SizeEnormous
-
-       To follow the XDG icon theme and icon naming specifications,
+    /* To follow the XDG icon theme and icon naming specifications,
        the order in which we look for an icon is:
 
        png, svgz, svg, xpm exact match
@@ -664,32 +638,7 @@
        (...)
 
        and so on.
-
-       If size parameter is a non-standard one, then we give more preference to
-       SVG format since drawing SVG's gives better quality and despite being
-       slower than resizing a PNG image, the cases where non-standard sizes are
-       asked are very rare. For non-standard sizes what we have is:
-
-       svgz, svg, png, xpm exact match
-       svgz, svg, png, xpm best match
-       less specific fallback in this theme: svgz, svg, png, xpm exact match
-                                             svgz, svg, png, xpm best match
-       even less specific fallback in this theme: [same order]
-       (...)
-
-       next theme in inheritance tree: svgz, svg, png, xpm exact match
-                                       svgz, svg, png, xpm best match
-       less specific fallbacks in this next theme
-       (...)
-
-       next theme in inheritance tree: svgz, svg, png, xpm exact match
-                                       svgz, svg, png, xpm best match
-       less specific fallbacks in this next theme
-       (...)
-
-       and so on.
        */
-
     foreach(KIconThemeNode *themeNode, links)
     {
         QStringList nameParts = name.split("-");
@@ -1032,6 +981,10 @@
     }
 
     // Scale the icon and apply effects if necessary
+    if (iconType == KIconLoader::Scalable && size != img->width())
+    {
+        *img = img->scaled(size, size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+    }
     if (iconType == KIconLoader::Threshold && size != img->width())
     {
         if ( abs(size-img->width())>iconThreshold )
--- trunk/KDE/kdelibs/kdeui/icons/kicontheme.cpp #725965:725966
@@ -471,7 +471,8 @@
              it's a downscale, and we only had upscales befores.
              This is to avoid scaling up unless we have to,
              since that looks very ugly */
-          if ((abs(dw) >= abs(delta)) || dw < 0)
+          if ((abs(dw) >= abs(delta)) ||
+              (delta > 0 && dw < 0))
             continue;
         }
 
@@ -479,7 +480,7 @@
         if (path.isEmpty())
             continue;
         icon.path = path;
-        icon.size = size;
+        icon.size = dir->size();
         icon.type = dir->type();
         icon.threshold = dir->threshold();
         icon.context = dir->context();
[prev in list] [next in list] [prev in thread] [next in thread] 

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