summaryrefslogtreecommitdiff
path: root/noncore/styles/phase/phasestyle.cpp
Side-by-side diff
Diffstat (limited to 'noncore/styles/phase/phasestyle.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/phase/phasestyle.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/noncore/styles/phase/phasestyle.cpp b/noncore/styles/phase/phasestyle.cpp
index 746354e..c2b9de8 100644
--- a/noncore/styles/phase/phasestyle.cpp
+++ b/noncore/styles/phase/phasestyle.cpp
@@ -381,25 +381,28 @@ void PhaseStyle::drawPushButtonLabel (QPushButton *button, QPainter *painter) {
} else {
mode = QIconSet::Disabled;
}
#if 0
if (button->isToggleButton() && button->isOn()) {
state = true;
} else {
state = false;
}
#endif
- pixmap = button->iconSet()->pixmap(QIconSet::Small, mode);
+ if ( mode == QIconSet::Disabled )
+ pixmap = button->iconSet()->pixmap( QIconSet::Automatic, mode );
+ else
+ pixmap = button->iconSet()->pixmap();
if (button->text().isEmpty() && !button->pixmap()) {
painter->drawPixmap(x+w/2 - pixmap.width()/2,
y+h/2 - pixmap.height()/2, pixmap);
} else {
painter->drawPixmap(x+4, y+h/2 - pixmap.height()/2, pixmap);
}
x += pixmap.width() + 4;
w -= pixmap.width() + 4;
}
if (active || button->isDefault()) { // default button
for(int n=0; n<2; n++) {
@@ -560,26 +563,25 @@ int PhaseStyle::popupMenuItemHeight ( bool ,
h += ITEMVMARGIN*2 + ITEMFRAME*2;
}else if (mi->isSeparator() ) {
h = 1;
}else {
if ( mi->pixmap() ) {
h = QMAX(h, mi->pixmap()->height() + ITEMFRAME*2);
}else {
h = QMAX(h, MINICONSIZE+ITEMFRAME*2 );
h = QMAX(h, fm.height()
+ ITEMVMARGIN*2 + ITEMFRAME*2 );
}
if ( mi->iconSet() )
- h = QMAX(h, mi->iconSet()->
- pixmap(QIconSet::Small, QIconSet::Normal ).height()
+ h = QMAX(h, mi->iconSet()->pixmap().height()
+ ITEMFRAME*2 );
}
return h;
}
int PhaseStyle::extraPopupMenuItemWidth(bool checkable, int maxpmw,
QMenuItem* mi, const QFontMetrics& ) {
int w = 0;
if (mi->isSeparator() )
return 3;
@@ -652,25 +654,29 @@ void PhaseStyle::drawPopupMenuItem ( QPainter * p, bool checkable,
p->drawLine( x+8, y-1, x+w-8, y-1 );
p->drawPoint(x+8, y );
return;
}
// draw icon
QIconSet::Mode mode;
if ( mi->iconSet() && !mi->isChecked() ) {
if ( act )
mode = enabled ? QIconSet::Active : QIconSet::Disabled;
else
mode = enabled ? QIconSet::Normal : QIconSet::Disabled;
- QPixmap pixmap = mi->iconSet()->pixmap(QIconSet::Small, mode );
+ QPixmap pixmap;
+ if ( mode == QIconSet::Disabled )
+ pixmap = mi->iconSet()->pixmap( QIconSet::Automatic, mode );
+ else
+ pixmap = mi->iconSet()->pixmap();
QRect pmrect(0, 0, pixmap.width(), pixmap.height() );
QRect cr(x, y, maxpmw, h );
pmrect.moveCenter( cr.center() );
p->drawPixmap(pmrect.topLeft(), pixmap);
}
// draw check
if(mi->isChecked() ) {
drawCheckMark(p, x, y, maxpmw, h, itemg, act, !enabled );
}