Diffstat (limited to 'noncore/styles/flat/flat.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/styles/flat/flat.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/noncore/styles/flat/flat.cpp b/noncore/styles/flat/flat.cpp index f3bacf9..c164ecc 100644 --- a/noncore/styles/flat/flat.cpp +++ b/noncore/styles/flat/flat.cpp | |||
@@ -373,7 +373,7 @@ void FlatStyle::drawPushButtonLabel( QPushButton *btn, QPainter *p ) | |||
373 | ? QIconSet::Normal : QIconSet::Disabled; | 373 | ? QIconSet::Normal : QIconSet::Disabled; |
374 | if ( mode == QIconSet::Normal && btn->hasFocus() ) | 374 | if ( mode == QIconSet::Normal && btn->hasFocus() ) |
375 | mode = QIconSet::Active; | 375 | mode = QIconSet::Active; |
376 | QPixmap pixmap = btn->iconSet()->pixmap( QIconSet::Small, mode ); | 376 | QPixmap pixmap = btn->iconSet()->pixmap( QIconSet::Automatic, mode ); |
377 | int pixw = pixmap.width(); | 377 | int pixw = pixmap.width(); |
378 | int pixh = pixmap.height(); | 378 | int pixh = pixmap.height(); |
379 | p->drawPixmap( x+2, y+h/2-pixh/2, pixmap ); | 379 | p->drawPixmap( x+2, y+h/2-pixh/2, pixmap ); |
@@ -391,8 +391,8 @@ QRect FlatStyle::comboButtonRect( int x, int y, int w, int h) | |||
391 | { | 391 | { |
392 | return QRect(x+2, y+2, w-4-13, h-4); | 392 | return QRect(x+2, y+2, w-4-13, h-4); |
393 | } | 393 | } |
394 | 394 | ||
395 | 395 | ||
396 | QRect FlatStyle::comboButtonFocusRect( int x, int y, int w, int h) | 396 | QRect FlatStyle::comboButtonFocusRect( int x, int y, int w, int h) |
397 | { | 397 | { |
398 | return QRect(x+2, y+2, w-4-14, h-4); | 398 | return QRect(x+2, y+2, w-4-14, h-4); |
@@ -892,7 +892,7 @@ int FlatStyle::extraPopupMenuItemWidth( bool checkable, int maxpmw, QMenuItem* m | |||
892 | */ | 892 | */ |
893 | int FlatStyle::popupMenuItemHeight( bool /*checkable*/, QMenuItem* mi, const QFontMetrics& fm ) | 893 | int FlatStyle::popupMenuItemHeight( bool /*checkable*/, QMenuItem* mi, const QFontMetrics& fm ) |
894 | { | 894 | { |
895 | #ifndef QT_NO_MENUDATA | 895 | #ifndef QT_NO_MENUDATA |
896 | int h = 0; | 896 | int h = 0; |
897 | if ( mi->isSeparator() ) // separator height | 897 | if ( mi->isSeparator() ) // separator height |
898 | h = motifSepHeight; | 898 | h = motifSepHeight; |
@@ -902,7 +902,7 @@ int FlatStyle::popupMenuItemHeight( bool /*checkable*/, QMenuItem* mi, const QFo | |||
902 | h = fm.height() + 2*motifItemVMargin + 2*motifItemFrame - 1; | 902 | h = fm.height() + 2*motifItemVMargin + 2*motifItemFrame - 1; |
903 | 903 | ||
904 | if ( !mi->isSeparator() && mi->iconSet() != 0 ) { | 904 | if ( !mi->isSeparator() && mi->iconSet() != 0 ) { |
905 | h = QMAX( h, mi->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height() + 2*motifItemFrame ); | 905 | h = QMAX( h, mi->iconSet()->pixmap().height() + 2*motifItemFrame ); |
906 | } | 906 | } |
907 | if ( mi->custom() ) | 907 | if ( mi->custom() ) |
908 | h = QMAX( h, mi->custom()->sizeHint().height() + 2*motifItemVMargin + 2*motifItemFrame ) - 1; | 908 | h = QMAX( h, mi->custom()->sizeHint().height() + 2*motifItemVMargin + 2*motifItemFrame ) - 1; |
@@ -914,7 +914,7 @@ void FlatStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int | |||
914 | const QPalette& pal, | 914 | const QPalette& pal, |
915 | bool act, bool enabled, int x, int y, int w, int h) | 915 | bool act, bool enabled, int x, int y, int w, int h) |
916 | { | 916 | { |
917 | #ifndef QT_NO_MENUDATA | 917 | #ifndef QT_NO_MENUDATA |
918 | const QColorGroup & g = pal.active(); | 918 | const QColorGroup & g = pal.active(); |
919 | bool dis = !enabled; | 919 | bool dis = !enabled; |
920 | QColorGroup itemg = dis ? pal.disabled() : pal.active(); | 920 | QColorGroup itemg = dis ? pal.disabled() : pal.active(); |
@@ -954,7 +954,11 @@ void FlatStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int | |||
954 | QIconSet::Mode mode = dis ? QIconSet::Disabled : QIconSet::Normal; | 954 | QIconSet::Mode mode = dis ? QIconSet::Disabled : QIconSet::Normal; |
955 | if (act && !dis ) | 955 | if (act && !dis ) |
956 | mode = QIconSet::Active; | 956 | mode = QIconSet::Active; |
957 | QPixmap pixmap = mi->iconSet()->pixmap( QIconSet::Small, mode ); | 957 | QPixmap pixmap; |
958 | if ( mode == QIconSet::Disabled ) | ||
959 | pixmap = mi->iconSet()->pixmap( QIconSet::Automatic, mode ); | ||
960 | else | ||
961 | pixmap = mi->iconSet()->pixmap(); | ||
958 | int pixw = pixmap.width(); | 962 | int pixw = pixmap.width(); |
959 | int pixh = pixmap.height(); | 963 | int pixh = pixmap.height(); |
960 | if ( act && !dis ) { | 964 | if ( act && !dis ) { |