src/hbcore/image/hbpixmapiconrenderer.cpp
changeset 21 4633027730f5
parent 5 627c4a0fd0e7
equal deleted inserted replaced
7:923ff622b8b9 21:4633027730f5
    98     }
    98     }
    99 }
    99 }
   100 
   100 
   101 void HbPixmapIconRenderer::applyIconProperties()
   101 void HbPixmapIconRenderer::applyIconProperties()
   102 {
   102 {
   103     if ((iconColor.isValid()) && (iconMode != QIcon::Disabled)) {
   103     if (iconMode != QIcon::Normal) {
       
   104         QStyleOption opt(0);
       
   105         opt.palette = QApplication::palette();
       
   106         pixmapData = QApplication::style()->generatedIconPixmap(iconMode, pixmapData, &opt);
       
   107     }
       
   108     if (iconColor.isValid()) {
   104         if (!pixmapData.isNull()) {
   109         if (!pixmapData.isNull()) {
   105             QPixmap mask = pixmapData.alphaChannel();
   110             QPixmap mask = pixmapData.alphaChannel();
   106             pixmapData.fill(iconColor);
   111             pixmapData.fill(iconColor);
   107             pixmapData.setAlphaChannel(mask);
   112             pixmapData.setAlphaChannel(mask);
   108         }
   113         }
   109     }
       
   110 
       
   111     // Apply the mode
       
   112     if (iconMode != QIcon::Normal) {
       
   113         QStyleOption opt(0);
       
   114         opt.palette = QApplication::palette();
       
   115         pixmapData = QApplication::style()->generatedIconPixmap(iconMode, pixmapData, &opt);
       
   116     }
   114     }
   117     iconPropertiesApplied = true;
   115     iconPropertiesApplied = true;
   118 }
   116 }
   119 
   117 
   120 QPixmap HbPixmapIconRenderer::getMaskedPixmap(HbMaskableIconImpl *maskIconData)
   118 QPixmap HbPixmapIconRenderer::getMaskedPixmap(HbMaskableIconImpl *maskIconData)