summaryrefslogtreecommitdiff
path: root/noncore/styles/liquid/liquid.cpp
authorsandman <sandman>2002-11-21 19:49:00 (UTC)
committer sandman <sandman>2002-11-21 19:49:00 (UTC)
commit440f1d4d439c83368a855355cdceda43660137f2 (patch) (side-by-side diff)
tree1b7ffd5157d2c141b9f978d08e47699ea2d013ff /noncore/styles/liquid/liquid.cpp
parent0b0ebb03a1fc0a316b52ce147d87fa89d3b5af16 (diff)
downloadopie-440f1d4d439c83368a855355cdceda43660137f2.zip
opie-440f1d4d439c83368a855355cdceda43660137f2.tar.gz
opie-440f1d4d439c83368a855355cdceda43660137f2.tar.bz2
- pixmaps in in menubars are now drawn (this is uncommon, but resulted in
blank icons in nethack for example) - small size optimization - updated the QPL diff
Diffstat (limited to 'noncore/styles/liquid/liquid.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/liquid/liquid.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp
index ba732aa..c8f8d20 100644
--- a/noncore/styles/liquid/liquid.cpp
+++ b/noncore/styles/liquid/liquid.cpp
@@ -2005,34 +2005,44 @@ void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h,
else
shadow = g.background().dark(130);
+ QPixmap *dummy = 0;
+
+ if ( mi-> pixmap ( ) && !mi-> pixmap ( )-> isNull ( )) {
+ dummy = new QPixmap ( mi-> pixmap ( )-> size ( ));
+ QBitmap dummy_mask ( dummy-> size ( ));
+ dummy_mask. fill ( color1 );
+ dummy-> setMask ( dummy_mask );
+ }
+
if(active){
drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background());
QApplication::style().drawItem(p, x+1, y+1, w, h,
AlignCenter|ShowPrefix|DontClip|SingleLine,
- g, mi->isEnabled(), NULL, mi->text(),
+ g, mi->isEnabled(), dummy, mi->text(),
-1, &shadow);
QApplication::style().drawItem(p, x, y, w, h,
AlignCenter|ShowPrefix|DontClip|SingleLine,
- g, mi->isEnabled(), NULL, mi->text(),
+ g, mi->isEnabled(), mi-> pixmap ( ), mi->text(),
-1, &g.text());
}
else{
QApplication::style().drawItem(p, x+1, y+1, w, h,
AlignCenter|ShowPrefix|DontClip|SingleLine,
- g, mi->isEnabled(), NULL, mi->text(),
+ g, mi->isEnabled(), dummy, mi->text(),
-1, &shadow);
QApplication::style().drawItem(p, x, y, w, h,
AlignCenter|ShowPrefix|DontClip|SingleLine,
- g, mi->isEnabled(), NULL, mi->text(),
+ g, mi->isEnabled(), mi-> pixmap ( ), mi->text(),
-1, &g.text());
}
+ delete dummy;
}
else{
if(active)
drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background());
QApplication::style().drawItem(p, x, y, w, h,
AlignCenter|ShowPrefix|DontClip|SingleLine,
- g, mi->isEnabled(), NULL, mi->text(),
+ g, mi->isEnabled(), mi-> pixmap ( ), mi->text(),
-1, &g.text());
}
}