Diffstat (limited to 'noncore/styles/liquid/liquid.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/styles/liquid/liquid.cpp | 20 |
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, | |||
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 | } |