Diffstat (limited to 'noncore/styles/liquid/liquid.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/styles/liquid/liquid.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp index 313d52c..acf0a42 100644 --- a/noncore/styles/liquid/liquid.cpp +++ b/noncore/styles/liquid/liquid.cpp | |||
@@ -75,13 +75,13 @@ TransMenuHandler::TransMenuHandler(QObject *parent) | |||
75 | 75 | ||
76 | void TransMenuHandler::reloadSettings() | 76 | void TransMenuHandler::reloadSettings() |
77 | { | 77 | { |
78 | pixDict.clear(); | 78 | pixDict.clear(); |
79 | 79 | ||
80 | Config config ( "qpe" ); | 80 | Config config ( "qpe" ); |
81 | config. setGroup ( "MosfetMenus" ); | 81 | config. setGroup ( "Liquid-Style" ); |
82 | 82 | ||
83 | type = config. readNumEntry("Type", TransStippleBg); | 83 | type = config. readNumEntry("Type", TransStippleBg); |
84 | color = QColor ( config. readEntry("Color", QApplication::palette().active().button().name())); | 84 | color = QColor ( config. readEntry("Color", QApplication::palette().active().button().name())); |
85 | fgColor = QColor ( config. readEntry("TextColor", QApplication::palette().active().text().name())); | 85 | fgColor = QColor ( config. readEntry("TextColor", QApplication::palette().active().text().name())); |
86 | opacity = config. readNumEntry("Opacity", 10); | 86 | opacity = config. readNumEntry("Opacity", 10); |
87 | if ( opacity < -20 ) | 87 | if ( opacity < -20 ) |
@@ -707,12 +707,19 @@ void LiquidStyle::polish(QPalette &appPal) | |||
707 | btnDict.clear(); | 707 | btnDict.clear(); |
708 | btnBorderDict.clear(); | 708 | btnBorderDict.clear(); |
709 | bevelFillDict.clear(); | 709 | bevelFillDict.clear(); |
710 | smallBevelFillDict.clear(); | 710 | smallBevelFillDict.clear(); |
711 | 711 | ||
712 | Config config ( "qpe" ); | 712 | Config config ( "qpe" ); |
713 | config. setGroup ( "Liquid-Style" ); | ||
714 | int contrast = config. readNumEntry ( "StippleContrast", 5 ); | ||
715 | if ( contrast < 0 ) | ||
716 | contrast = 0; | ||
717 | else if ( contrast > 10 ) | ||
718 | contrast = 10; | ||
719 | |||
713 | QPalette pal = QApplication::palette(); | 720 | QPalette pal = QApplication::palette(); |
714 | 721 | ||
715 | // button color stuff | 722 | // button color stuff |
716 | config. setGroup ( "Appearance" ); | 723 | config. setGroup ( "Appearance" ); |
717 | QColor c = QColor ( config. readEntry("Button", ( Qt::lightGray ). name ( ))); | 724 | QColor c = QColor ( config. readEntry("Button", ( Qt::lightGray ). name ( ))); |
718 | if ( c == QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( )))) { | 725 | if ( c == QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( )))) { |
@@ -778,15 +785,15 @@ void LiquidStyle::polish(QPalette &appPal) | |||
778 | 785 | ||
779 | // background brush | 786 | // background brush |
780 | QPixmap wallPaper(32, 32); | 787 | QPixmap wallPaper(32, 32); |
781 | wallPaper.fill(c.rgb()); | 788 | wallPaper.fill(c.rgb()); |
782 | painter.begin(&wallPaper); | 789 | painter.begin(&wallPaper); |
783 | for(i=0; i < 32; i+=4){ | 790 | for(i=0; i < 32; i+=4){ |
784 | painter.setPen(c.dark(105)); | 791 | painter.setPen(c.dark(100 + contrast)); |
785 | painter.drawLine(0, i, 32, i); | 792 | painter.drawLine(0, i, 32, i); |
786 | painter.setPen(c.dark(103)); | 793 | painter.setPen(c.dark(100 + 3 * contrast / 5 ) ); |
787 | painter.drawLine(0, i+1, 32, i+1); | 794 | painter.drawLine(0, i+1, 32, i+1); |
788 | }; | 795 | }; |
789 | painter.end(); | 796 | painter.end(); |
790 | bgBrush.setColor(c); | 797 | bgBrush.setColor(c); |
791 | bgBrush.setPixmap(wallPaper); | 798 | bgBrush.setPixmap(wallPaper); |
792 | appPal.setBrush(QColorGroup::Background, bgBrush); | 799 | appPal.setBrush(QColorGroup::Background, bgBrush); |
@@ -986,12 +993,16 @@ void LiquidStyle::polish(QApplication *app) | |||
986 | app->setEffectEnabled(UI_AnimateMenu, false); | 993 | app->setEffectEnabled(UI_AnimateMenu, false); |
987 | if(menuFade) | 994 | if(menuFade) |
988 | app->setEffectEnabled(UI_FadeMenu, false); | 995 | app->setEffectEnabled(UI_FadeMenu, false); |
989 | 996 | ||
990 | qt_set_draw_menu_bar_impl((QDrawMenuBarItemImpl) &LiquidStyle::drawMenuBarItem); | 997 | qt_set_draw_menu_bar_impl((QDrawMenuBarItemImpl) &LiquidStyle::drawMenuBarItem); |
991 | 998 | ||
999 | Config config ( "qpe" ); | ||
1000 | config. setGroup ( "Liquid-Style" ); | ||
1001 | |||
1002 | if ( config. readBoolEntry ( "WinDecoration", true )) | ||
992 | QApplication::qwsSetDecoration ( new LiquidDecoration ( )); | 1003 | QApplication::qwsSetDecoration ( new LiquidDecoration ( )); |
993 | } | 1004 | } |
994 | 1005 | ||
995 | void LiquidStyle::unPolish(QApplication *app) | 1006 | void LiquidStyle::unPolish(QApplication *app) |
996 | { | 1007 | { |
997 | QWindowsStyle::unPolish(app); | 1008 | QWindowsStyle::unPolish(app); |