Diffstat (limited to 'noncore/styles/liquid/liquid.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/styles/liquid/liquid.cpp | 19 |
1 files changed, 15 insertions, 4 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 | |||
@@ -69,25 +69,25 @@ void TransMenuHandler::stripePixmap(QPixmap &pix, const QColor &color) | |||
69 | TransMenuHandler::TransMenuHandler(QObject *parent) | 69 | TransMenuHandler::TransMenuHandler(QObject *parent) |
70 | : QObject(parent) | 70 | : QObject(parent) |
71 | { | 71 | { |
72 | pixDict.setAutoDelete(true); | 72 | pixDict.setAutoDelete(true); |
73 | reloadSettings(); | 73 | reloadSettings(); |
74 | } | 74 | } |
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 ) |
88 | opacity = 20; | 88 | opacity = 20; |
89 | else if ( opacity > 20 ) | 89 | else if ( opacity > 20 ) |
90 | opacity = 20; | 90 | opacity = 20; |
91 | 91 | ||
92 | shadowText = config. readBoolEntry("ShadowText", true); | 92 | shadowText = config. readBoolEntry("ShadowText", true); |
93 | } | 93 | } |
@@ -701,24 +701,31 @@ void LiquidStyle::polish(QPalette &appPal) | |||
701 | unapplyCustomAttributes((QPushButton *)w); | 701 | unapplyCustomAttributes((QPushButton *)w); |
702 | } | 702 | } |
703 | } | 703 | } |
704 | 704 | ||
705 | loadCustomButtons(); | 705 | loadCustomButtons(); |
706 | lowLightVal = 100 + (2* /*KGlobalSettings::contrast()*/ 3 +4)*10; | 706 | lowLightVal = 100 + (2* /*KGlobalSettings::contrast()*/ 3 +4)*10; |
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 ( )))) { |
719 | // force button color to be different from background | 726 | // force button color to be different from background |
720 | QBrush btnBrush(QColor(200, 202, 228)); | 727 | QBrush btnBrush(QColor(200, 202, 228)); |
721 | appPal.setBrush(QColorGroup::Button, btnBrush); | 728 | appPal.setBrush(QColorGroup::Button, btnBrush); |
722 | } | 729 | } |
723 | c.hsv(&btnH, &btnS, &btnV); | 730 | c.hsv(&btnH, &btnS, &btnV); |
724 | c.light(120).hsv(&btnHoverH, &btnHoverS, &btnHoverV); | 731 | c.light(120).hsv(&btnHoverH, &btnHoverS, &btnHoverV); |
@@ -772,27 +779,27 @@ void LiquidStyle::polish(QPalette &appPal) | |||
772 | 779 | ||
773 | // FIXME? | 780 | // FIXME? |
774 | if(vsbSliderFillPix) | 781 | if(vsbSliderFillPix) |
775 | delete vsbSliderFillPix; | 782 | delete vsbSliderFillPix; |
776 | vsbSliderFillPix = new QPixmap(bevelFillPix->xForm(rMatrix)); | 783 | vsbSliderFillPix = new QPixmap(bevelFillPix->xForm(rMatrix)); |
777 | adjustHSV(*vsbSliderFillPix, bH, bS, bV); | 784 | adjustHSV(*vsbSliderFillPix, bH, bS, bV); |
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); |
793 | 800 | ||
794 | // lineedits | 801 | // lineedits |
795 | c = QColor ( config. readEntry("Base", ( Qt::white). name ( ))); | 802 | c = QColor ( config. readEntry("Base", ( Qt::white). name ( ))); |
796 | QPixmap basePix; | 803 | QPixmap basePix; |
797 | basePix.resize(32, 32); | 804 | basePix.resize(32, 32); |
798 | basePix.fill(c.rgb()); | 805 | basePix.fill(c.rgb()); |
@@ -980,25 +987,29 @@ void LiquidStyle::polish(QApplication *app) | |||
980 | { | 987 | { |
981 | 988 | ||
982 | QWindowsStyle::polish(app); | 989 | QWindowsStyle::polish(app); |
983 | menuAni = app->isEffectEnabled(UI_AnimateMenu); | 990 | menuAni = app->isEffectEnabled(UI_AnimateMenu); |
984 | menuFade = app->isEffectEnabled(UI_FadeMenu); | 991 | menuFade = app->isEffectEnabled(UI_FadeMenu); |
985 | if(menuAni) | 992 | if(menuAni) |
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 | ||
992 | QApplication::qwsSetDecoration ( new LiquidDecoration ( )); | 999 | Config config ( "qpe" ); |
1000 | config. setGroup ( "Liquid-Style" ); | ||
1001 | |||
1002 | if ( config. readBoolEntry ( "WinDecoration", true )) | ||
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); |
998 | app->setEffectEnabled(UI_AnimateMenu, menuAni); | 1009 | app->setEffectEnabled(UI_AnimateMenu, menuAni); |
999 | app->setEffectEnabled(UI_FadeMenu, menuFade); | 1010 | app->setEffectEnabled(UI_FadeMenu, menuFade); |
1000 | 1011 | ||
1001 | qt_set_draw_menu_bar_impl ( 0 ); | 1012 | qt_set_draw_menu_bar_impl ( 0 ); |
1002 | 1013 | ||
1003 | QApplication::qwsSetDecoration ( new QPEDecoration ( )); | 1014 | QApplication::qwsSetDecoration ( new QPEDecoration ( )); |
1004 | } | 1015 | } |