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 | |||
@@ -169,6 +169,8 @@ LiquidStyle::LiquidStyle() | |||
169 | { | 169 | { |
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); |
174 | htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); | 176 | htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); |
@@ -831,6 +833,13 @@ void LiquidStyle::polish(QWidget *w) | |||
831 | if(w->inherits("QMenuBar")){ | 833 | if(w->inherits("QMenuBar")){ |
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 | } |
836 | if(w->inherits("QPopupMenu")) | 845 | if(w->inherits("QPopupMenu")) |
@@ -893,8 +902,10 @@ void LiquidStyle::polish(QWidget *w) | |||
893 | w->setMouseTracking(true); | 902 | w->setMouseTracking(true); |
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")){ |
900 | return; | 911 | return; |
@@ -912,11 +923,6 @@ void LiquidStyle::polish(QWidget *w) | |||
912 | w->setBackgroundMode(QWidget::X11ParentRelative); | 923 | w->setBackgroundMode(QWidget::X11ParentRelative); |
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 | } |
922 | 928 | ||
@@ -1001,6 +1007,8 @@ void LiquidStyle::polish(QApplication *app) | |||
1001 | 1007 | ||
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 | ||
1006 | void LiquidStyle::unPolish(QApplication *app) | 1014 | void LiquidStyle::unPolish(QApplication *app) |
@@ -1998,8 +2006,10 @@ void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, | |||
1998 | w += 2; | 2006 | w += 2; |
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()){ |
2005 | QColor shadow; | 2015 | QColor shadow; |