summaryrefslogtreecommitdiff
path: root/noncore/styles/theme/othemestyle.cpp
Unidiff
Diffstat (limited to 'noncore/styles/theme/othemestyle.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/styles/theme/othemestyle.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/noncore/styles/theme/othemestyle.cpp b/noncore/styles/theme/othemestyle.cpp
index 98e7253..106d206 100644
--- a/noncore/styles/theme/othemestyle.cpp
+++ b/noncore/styles/theme/othemestyle.cpp
@@ -1180,13 +1180,13 @@ void OThemeStyle::drawPushButtonLabel( QPushButton *btn, QPainter *p )
1180 // Next, draw iconset, if any 1180 // Next, draw iconset, if any
1181 if ( btn->iconSet() && !btn->iconSet() ->isNull() ) { 1181 if ( btn->iconSet() && !btn->iconSet() ->isNull() ) {
1182 QIconSet::Mode mode = btn->isEnabled() 1182 QIconSet::Mode mode = btn->isEnabled()
1183 ? QIconSet::Normal : QIconSet::Disabled; 1183 ? QIconSet::Normal : QIconSet::Disabled;
1184 if ( mode == QIconSet::Normal && btn->hasFocus() ) 1184 if ( mode == QIconSet::Normal && btn->hasFocus() )
1185 mode = QIconSet::Active; 1185 mode = QIconSet::Active;
1186 QPixmap pixmap = btn->iconSet() ->pixmap( QIconSet::Small, mode ); 1186 QPixmap pixmap = btn->iconSet() ->pixmap( QIconSet::Automatic, mode );
1187 int pixw = pixmap.width(); 1187 int pixw = pixmap.width();
1188 int pixh = pixmap.height(); 1188 int pixh = pixmap.height();
1189 1189
1190 p->drawPixmap( x + 6, y + h / 2 - pixh / 2, pixmap ); 1190 p->drawPixmap( x + 6, y + h / 2 - pixh / 2, pixmap );
1191 x += pixw + 8; 1191 x += pixw + 8;
1192 w -= pixw + 8; 1192 w -= pixw + 8;
@@ -1243,14 +1243,13 @@ int OThemeStyle::popupMenuItemHeight( bool /*checkable*/, QMenuItem *mi,
1243 offset + 16; 1243 offset + 16;
1244 if ( mi->pixmap() ) { 1244 if ( mi->pixmap() ) {
1245 h2 = mi->pixmap() ->height() + offset; 1245 h2 = mi->pixmap() ->height() + offset;
1246 h = h2 > h ? h2 : h; 1246 h = h2 > h ? h2 : h;
1247 } 1247 }
1248 if ( mi->iconSet() ) { 1248 if ( mi->iconSet() ) {
1249 h2 = mi->iconSet() -> 1249 h2 = mi->iconSet() ->pixmap().height() + offset;
1250 pixmap( QIconSet::Small, QIconSet::Normal ).height() + offset;
1251 h = h2 > h ? h2 : h; 1250 h = h2 > h ? h2 : h;
1252 } 1251 }
1253 h2 = fm.height() + offset; 1252 h2 = fm.height() + offset;
1254 h = h2 > h ? h2 : h; 1253 h = h2 > h ? h2 : h;
1255 return ( h ); 1254 return ( h );
1256} 1255}
@@ -1322,13 +1321,17 @@ void OThemeStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw,
1322 if ( !mi ) 1321 if ( !mi )
1323 return ; 1322 return ;
1324 if ( mi->iconSet() ) { 1323 if ( mi->iconSet() ) {
1325 QIconSet::Mode mode = dis ? QIconSet::Disabled : QIconSet::Normal; 1324 QIconSet::Mode mode = dis ? QIconSet::Disabled : QIconSet::Normal;
1326 if ( act && !dis ) 1325 if ( act && !dis )
1327 mode = QIconSet::Active; 1326 mode = QIconSet::Active;
1328 QPixmap pixmap = mi->iconSet() ->pixmap( QIconSet::Small, mode ); 1327 QPixmap pixmap;
1328 if ( mode == QIconSet::Disabled )
1329 pixmap = mi->iconSet()->pixmap( QIconSet::Automatic, mode );
1330 else
1331 pixmap = mi->iconSet()->pixmap();
1329 int pixw = pixmap.width(); 1332 int pixw = pixmap.width();
1330 int pixh = pixmap.height(); 1333 int pixh = pixmap.height();
1331 QRect cr( x, y, checkcol, h ); 1334 QRect cr( x, y, checkcol, h );
1332 QRect pmr( 0, 0, pixw, pixh ); 1335 QRect pmr( 0, 0, pixw, pixh );
1333 pmr.moveCenter( cr.center() ); 1336 pmr.moveCenter( cr.center() );
1334 p->setPen( itemg.text() ); 1337 p->setPen( itemg.text() );