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) (unidiff)
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
@@ -2002,40 +2002,50 @@ void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h,
2002 shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : 2002 shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) :
2003 g.background().dark(130); 2003 g.background().dark(130);
2004 } 2004 }
2005 else 2005 else
2006 shadow = g.background().dark(130); 2006 shadow = g.background().dark(130);
2007 2007
2008 QPixmap *dummy = 0;
2009
2010 if ( mi-> pixmap ( ) && !mi-> pixmap ( )-> isNull ( )) {
2011 dummy = new QPixmap ( mi-> pixmap ( )-> size ( ));
2012 QBitmap dummy_mask ( dummy-> size ( ));
2013 dummy_mask. fill ( color1 );
2014 dummy-> setMask ( dummy_mask );
2015 }
2016
2008 if(active){ 2017 if(active){
2009 drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background()); 2018 drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background());
2010 QApplication::style().drawItem(p, x+1, y+1, w, h, 2019 QApplication::style().drawItem(p, x+1, y+1, w, h,
2011 AlignCenter|ShowPrefix|DontClip|SingleLine, 2020 AlignCenter|ShowPrefix|DontClip|SingleLine,
2012 g, mi->isEnabled(), NULL, mi->text(), 2021 g, mi->isEnabled(), dummy, mi->text(),
2013 -1, &shadow); 2022 -1, &shadow);
2014 QApplication::style().drawItem(p, x, y, w, h, 2023 QApplication::style().drawItem(p, x, y, w, h,
2015 AlignCenter|ShowPrefix|DontClip|SingleLine, 2024 AlignCenter|ShowPrefix|DontClip|SingleLine,
2016 g, mi->isEnabled(), NULL, mi->text(), 2025 g, mi->isEnabled(), mi-> pixmap ( ), mi->text(),
2017 -1, &g.text()); 2026 -1, &g.text());
2018 } 2027 }
2019 else{ 2028 else{
2020 QApplication::style().drawItem(p, x+1, y+1, w, h, 2029 QApplication::style().drawItem(p, x+1, y+1, w, h,
2021 AlignCenter|ShowPrefix|DontClip|SingleLine, 2030 AlignCenter|ShowPrefix|DontClip|SingleLine,
2022 g, mi->isEnabled(), NULL, mi->text(), 2031 g, mi->isEnabled(), dummy, mi->text(),
2023 -1, &shadow); 2032 -1, &shadow);
2024 QApplication::style().drawItem(p, x, y, w, h, 2033 QApplication::style().drawItem(p, x, y, w, h,
2025 AlignCenter|ShowPrefix|DontClip|SingleLine, 2034 AlignCenter|ShowPrefix|DontClip|SingleLine,
2026 g, mi->isEnabled(), NULL, mi->text(), 2035 g, mi->isEnabled(), mi-> pixmap ( ), mi->text(),
2027 -1, &g.text()); 2036 -1, &g.text());
2028 } 2037 }
2038 delete dummy;
2029 } 2039 }
2030 else{ 2040 else{
2031 if(active) 2041 if(active)
2032 drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background()); 2042 drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background());
2033 QApplication::style().drawItem(p, x, y, w, h, 2043 QApplication::style().drawItem(p, x, y, w, h,
2034 AlignCenter|ShowPrefix|DontClip|SingleLine, 2044 AlignCenter|ShowPrefix|DontClip|SingleLine,
2035 g, mi->isEnabled(), NULL, mi->text(), 2045 g, mi->isEnabled(), mi-> pixmap ( ), mi->text(),
2036 -1, &g.text()); 2046 -1, &g.text());
2037 } 2047 }
2038} 2048}
2039 2049
2040void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h, 2050void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h,
2041 const QColorGroup &g, int /*lineWidth*/, 2051 const QColorGroup &g, int /*lineWidth*/,