summaryrefslogtreecommitdiff
path: root/noncore/styles/liquid/liquid.cpp
Unidiff
Diffstat (limited to 'noncore/styles/liquid/liquid.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/styles/liquid/liquid.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp
index 51814e7..77cf198 100644
--- a/noncore/styles/liquid/liquid.cpp
+++ b/noncore/styles/liquid/liquid.cpp
@@ -1300,13 +1300,17 @@ void LiquidStyle::drawPushButtonLabel(QPushButton *btn, QPainter *p)
1300 if ( btn->iconSet() && !btn->iconSet()->isNull() ) 1300 if ( btn->iconSet() && !btn->iconSet()->isNull() )
1301 { 1301 {
1302 QIconSet::Mode mode = btn->isEnabled() 1302 QIconSet::Mode mode = btn->isEnabled()
1303 ? QIconSet::Normal : QIconSet::Disabled; 1303 ? QIconSet::Normal : QIconSet::Disabled;
1304 if ( mode == QIconSet::Normal && btn->hasFocus() ) 1304 if ( mode == QIconSet::Normal && btn->hasFocus() )
1305 mode = QIconSet::Active; 1305 mode = QIconSet::Active;
1306 QPixmap pixmap = btn->iconSet()->pixmap( QIconSet::Small, mode ); 1306 QPixmap pixmap;
1307 if ( mode == QIconSet::Disabled )
1308 pixmap = btn->iconSet()->pixmap( QIconSet::Automatic, mode );
1309 else
1310 pixmap = btn->iconSet()->pixmap();
1307 int pixw = pixmap.width(); 1311 int pixw = pixmap.width();
1308 int pixh = pixmap.height(); 1312 int pixh = pixmap.height();
1309 1313
1310 p->drawPixmap( x1+6, y1+h/2-pixh/2, pixmap ); 1314 p->drawPixmap( x1+6, y1+h/2-pixh/2, pixmap );
1311 x1 += pixw + 8; 1315 x1 += pixw + 8;
1312 w -= pixw + 8; 1316 w -= pixw + 8;
@@ -2152,13 +2156,17 @@ static const int windowsRightBorder = 12;
2152 return; 2156 return;
2153 } 2157 }
2154 if(mi->iconSet()) { 2158 if(mi->iconSet()) {
2155 QIconSet::Mode mode = dis? QIconSet::Disabled : QIconSet::Normal; 2159 QIconSet::Mode mode = dis? QIconSet::Disabled : QIconSet::Normal;
2156 if (!dis) 2160 if (!dis)
2157 mode = QIconSet::Active; 2161 mode = QIconSet::Active;
2158 QPixmap pixmap = mi->iconSet()->pixmap(QIconSet::Small, mode); 2162 QPixmap pixmap;
2163 if ( mode == QIconSet::Disabled )
2164 pixmap = mi->iconSet()->pixmap( QIconSet::Automatic, mode );
2165 else
2166 pixmap = mi->iconSet()->pixmap();
2159 int pixw = pixmap.width(); 2167 int pixw = pixmap.width();
2160 int pixh = pixmap.height(); 2168 int pixh = pixmap.height();
2161 QRect cr(x, y, checkcol, h); 2169 QRect cr(x, y, checkcol, h);
2162 QRect pmr(0, 0, pixw, pixh); 2170 QRect pmr(0, 0, pixw, pixh);
2163 pmr.moveCenter( cr.center() ); 2171 pmr.moveCenter( cr.center() );
2164 p->setPen(itemg.highlightedText()); 2172 p->setPen(itemg.highlightedText());
@@ -2233,14 +2241,13 @@ int LiquidStyle::popupMenuItemHeight(bool /*checkable*/, QMenuItem *mi,
2233 2241
2234 int h = 0; 2242 int h = 0;
2235 if (mi->pixmap()) 2243 if (mi->pixmap())
2236 h = mi->pixmap()->height(); 2244 h = mi->pixmap()->height();
2237 2245
2238 if (mi->iconSet()) 2246 if (mi->iconSet())
2239 h = QMAX(mi->iconSet()-> 2247 h = QMAX(mi->iconSet()->pixmap().height(), h);
2240 pixmap(QIconSet::Small, QIconSet::Normal).height(), h);
2241 2248
2242 h = QMAX(fm.height() + 4, h); 2249 h = QMAX(fm.height() + 4, h);
2243 2250
2244 // we want a minimum size of 18 2251 // we want a minimum size of 18
2245 h = QMAX(h, 18); 2252 h = QMAX(h, 18);
2246 2253