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

List:       kde-commits
Subject:    KDE/kdelibs/kdeui/icons
From:       Christoph Feck <christoph () maxiom ! de>
Date:       2009-03-28 14:06:15
Message-ID: 1238249175.109468.2709.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 945882 by cfeck:

Use alpha channel for semi transparent 8 bit icons

I was long looking at this bug, but did not find the culprit until I
fired Okteta and looked at the PNG files. Some icons are optimized
to palettized mode (8 bit icons), and this made KIconEffect use the
ugly checked pattern.

BUG: 165460


 M  +12 -0     kiconeffect.cpp  


--- trunk/KDE/kdelibs/kdeui/icons/kiconeffect.cpp #945881:945882
@@ -528,6 +528,18 @@
         }
     }
     else{
+        if (img.depth() == 8) {
+            QPaintEngine *pe = QApplication::desktop()->paintEngine();
+            if (pe && pe->hasFeature(QPaintEngine::Antialiasing)) {
+                // not running on 8 bit, we can safely install a new colorTable
+                QVector<QRgb> colorTable = img.colorTable();
+                for (int i = 0; i < colorTable.size(); ++i) {
+                    colorTable[i] = (colorTable[i] & 0x00ffffff) | ((colorTable[i] & 0xfe000000) >> 1);
+                }
+                img.setColorTable(colorTable);
+                return;
+            }
+        }
         // Insert transparent pixel into the clut.
         int transColor = -1;
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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