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

List:       kde-commits
Subject:    KDE/kdelibs/kdeui/icons
From:       Carlo Segato <brandon.ml () gmail ! com>
Date:       2009-07-16 22:47:51
Message-ID: 1247784471.917390.29120.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 998111 by segato:

apparently QApplication::desktop()->paintEngine() is null on windows, so the check \
for antialiasing support fails even if we support it(or at least I hope so), this way \
we can have smooth icons effects on windows too


 M  +10 -1     kiconeffect.cpp  


--- trunk/KDE/kdelibs/kdeui/icons/kiconeffect.cpp #998110:998111
@@ -505,8 +505,10 @@
         int width  = img.width();
 	int height = img.height();
 
+#ifndef Q_WS_WIN
         QPaintEngine* pe = QApplication::desktop()->paintEngine();
         if(pe && pe->hasFeature(QPaintEngine::Antialiasing)){
+#endif
             unsigned char *line;
             for(y=0; y<height; y++){
                 if(QSysInfo::ByteOrder == QSysInfo::BigEndian)
@@ -518,6 +520,7 @@
                     line += 4;
                 }
             }
+#ifndef Q_WS_WIN
         }
         else{
             for(y=0; y<height; y++){
@@ -526,11 +529,15 @@
                     line[x] &= 0x00ffffff;
             }
         }
+#endif
     }
     else{
         if (img.depth() == 8) {
+#ifndef Q_WS_WIN
             QPaintEngine *pe = QApplication::desktop()->paintEngine();
-            if (pe && pe->hasFeature(QPaintEngine::Antialiasing)) {
+            if (pe && pe->hasFeature(QPaintEngine::Antialiasing))
+#endif
+            {
                 // 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) {
@@ -595,7 +602,9 @@
 
 void KIconEffect::semiTransparent(QPixmap &pix)
 {
+#ifndef Q_WS_WIN
     if (QApplication::desktop()->paintEngine() && \
QApplication::desktop()->paintEngine()->hasFeature(QPaintEngine::Antialiasing)) \
+#endif  {
         QImage img=pix.toImage();
         semiTransparent(img);


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

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