Diffstat (limited to 'noncore/styles/liquid/liquid.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/styles/liquid/liquid.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp index 87b5488..22bf8af 100644 --- a/noncore/styles/liquid/liquid.cpp +++ b/noncore/styles/liquid/liquid.cpp | |||
@@ -170,4 +170,6 @@ LiquidStyle::LiquidStyle() | |||
170 | setName ( "LiquidStyle" ); | 170 | setName ( "LiquidStyle" ); |
171 | 171 | ||
172 | flatTBButtons = false; | ||
173 | |||
172 | btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); | 174 | btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); |
173 | btnMaskBmp.setMask(btnMaskBmp); | 175 | btnMaskBmp.setMask(btnMaskBmp); |
@@ -832,4 +834,11 @@ void LiquidStyle::polish(QWidget *w) | |||
832 | //((QFrame*)w)->setLineWidth(0); | 834 | //((QFrame*)w)->setLineWidth(0); |
833 | w->setBackgroundMode(QWidget::PaletteBackground); | 835 | w->setBackgroundMode(QWidget::PaletteBackground); |
836 | w->setBackgroundOrigin(QWidget::ParentOrigin); | ||
837 | return; | ||
838 | } | ||
839 | if(w->inherits("QToolBar")){ | ||
840 | w->installEventFilter(this); | ||
841 | w->setBackgroundMode(QWidget::PaletteBackground); | ||
842 | w->setBackgroundOrigin(QWidget::WidgetOrigin); | ||
834 | return; | 843 | return; |
835 | } | 844 | } |
@@ -894,6 +903,8 @@ void LiquidStyle::polish(QWidget *w) | |||
894 | w->installEventFilter(this); | 903 | w->installEventFilter(this); |
895 | } | 904 | } |
896 | if(w-> inherits("QToolButton")) { | 905 | if(w-> inherits("QToolButton")&&w->parent()->inherits("QToolBar")) { |
897 | ((QToolButton*)w)->setAutoRaise (false); | 906 | ((QToolButton*)w)->setAutoRaise (flatTBButtons); |
907 | if ( flatTBButtons ) | ||
908 | w->setBackgroundOrigin(QWidget::ParentOrigin); | ||
898 | } | 909 | } |
899 | if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){ | 910 | if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){ |
@@ -913,9 +924,4 @@ void LiquidStyle::polish(QWidget *w) | |||
913 | } | 924 | } |
914 | } | 925 | } |
915 | if(w->inherits("QToolBar")){ | ||
916 | w->installEventFilter(this); | ||
917 | w->setBackgroundMode(QWidget::PaletteBackground); | ||
918 | return; | ||
919 | } | ||
920 | 926 | ||
921 | } | 927 | } |
@@ -1002,4 +1008,6 @@ void LiquidStyle::polish(QApplication *app) | |||
1002 | if ( config. readBoolEntry ( "WinDecoration", true )) | 1008 | if ( config. readBoolEntry ( "WinDecoration", true )) |
1003 | QApplication::qwsSetDecoration ( new LiquidDecoration ( )); | 1009 | QApplication::qwsSetDecoration ( new LiquidDecoration ( )); |
1010 | |||
1011 | flatTBButtons = config. readBoolEntry ( "FlatToolButtons", false ); | ||
1004 | } | 1012 | } |
1005 | 1013 | ||
@@ -1999,6 +2007,8 @@ void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, | |||
1999 | h += 2; | 2007 | h += 2; |
2000 | } | 2008 | } |
2001 | 2009 | ||
2002 | p-> fillRect ( x, y, w, h, g.brush(QColorGroup::Background)); | 2010 | QWidget *parent = (QWidget *)p->device(); |
2011 | p->setBrushOrigin(parent->pos()); | ||
2012 | parent->erase(x, y, w, h); | ||
2003 | 2013 | ||
2004 | if(menuHandler->useShadowText()){ | 2014 | if(menuHandler->useShadowText()){ |