author | sandman <sandman> | 2002-09-21 01:31:23 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-09-21 01:31:23 (UTC) |
commit | 804a06520928973d706bf827209f8a7625010b7f (patch) (unidiff) | |
tree | 06865733a58dbd033747ef6ceca9bd6c51f24455 | |
parent | 6ae824e5c3a555d5129c68d387094d50276742f4 (diff) | |
download | opie-804a06520928973d706bf827209f8a7625010b7f.zip opie-804a06520928973d706bf827209f8a7625010b7f.tar.gz opie-804a06520928973d706bf827209f8a7625010b7f.tar.bz2 |
- disable liquid win decoration - this has to be made a separate plugin
- liquid now uses the polished palette for color values (liquid did parse
qpe.conf before -- the new Qt/e patch is needed for this to work)
- updated QPL diff
-rw-r--r-- | noncore/styles/liquid/liquid.cpp | 23 | ||||
-rw-r--r-- | noncore/styles/liquid/opie-liquid.diff | 128 |
2 files changed, 87 insertions, 64 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp index 22bf8af..0d9d259 100644 --- a/noncore/styles/liquid/liquid.cpp +++ b/noncore/styles/liquid/liquid.cpp | |||
@@ -676,25 +676,24 @@ QPixmap* LiquidStyle::getPixmap(BitmapData item) | |||
676 | case HSBSliderMidBg: | 676 | case HSBSliderMidBg: |
677 | pixmaps[HSBSliderMidBg] = processEmbedded("sbslider_mid", bH, bS, bV); | 677 | pixmaps[HSBSliderMidBg] = processEmbedded("sbslider_mid", bH, bS, bV); |
678 | *pixmaps[HSBSliderMidBg] = pixmaps[HSBSliderMidBg]->xForm(rMatrix); | 678 | *pixmaps[HSBSliderMidBg] = pixmaps[HSBSliderMidBg]->xForm(rMatrix); |
679 | break; | 679 | break; |
680 | default: | 680 | default: |
681 | break; | 681 | break; |
682 | } | 682 | } |
683 | return(pixmaps[item]); | 683 | return(pixmaps[item]); |
684 | } | 684 | } |
685 | 685 | ||
686 | void LiquidStyle::polish(QPalette &appPal) | 686 | void LiquidStyle::polish(QPalette &appPal) |
687 | { | 687 | { |
688 | |||
689 | int i; | 688 | int i; |
690 | for(i=0; i < BITMAP_ITEMS; ++i){ | 689 | for(i=0; i < BITMAP_ITEMS; ++i){ |
691 | if(pixmaps[i]){ | 690 | if(pixmaps[i]){ |
692 | delete pixmaps[i]; | 691 | delete pixmaps[i]; |
693 | pixmaps[i] = NULL; | 692 | pixmaps[i] = NULL; |
694 | } | 693 | } |
695 | } | 694 | } |
696 | QWidgetList *list = QApplication::allWidgets(); | 695 | QWidgetList *list = QApplication::allWidgets(); |
697 | QWidgetListIt it( *list ); | 696 | QWidgetListIt it( *list ); |
698 | QWidget *w; | 697 | QWidget *w; |
699 | while ((w=it.current()) != 0 ){ | 698 | while ((w=it.current()) != 0 ){ |
700 | ++it; | 699 | ++it; |
@@ -709,30 +708,33 @@ void LiquidStyle::polish(QPalette &appPal) | |||
709 | btnBorderDict.clear(); | 708 | btnBorderDict.clear(); |
710 | bevelFillDict.clear(); | 709 | bevelFillDict.clear(); |
711 | smallBevelFillDict.clear(); | 710 | smallBevelFillDict.clear(); |
712 | 711 | ||
713 | Config config ( "qpe" ); | 712 | Config config ( "qpe" ); |
714 | config. setGroup ( "Liquid-Style" ); | 713 | config. setGroup ( "Liquid-Style" ); |
715 | int contrast = config. readNumEntry ( "StippleContrast", 5 ); | 714 | int contrast = config. readNumEntry ( "StippleContrast", 5 ); |
716 | if ( contrast < 0 ) | 715 | if ( contrast < 0 ) |
717 | contrast = 0; | 716 | contrast = 0; |
718 | else if ( contrast > 10 ) | 717 | else if ( contrast > 10 ) |
719 | contrast = 10; | 718 | contrast = 10; |
720 | 719 | ||
721 | QPalette pal = QApplication::palette(); | 720 | // QPalette pal = QApplication::palette(); |
722 | 721 | ||
723 | // button color stuff | 722 | // button color stuff |
724 | config. setGroup ( "Appearance" ); | 723 | config. setGroup ( "Appearance" ); |
725 | QColor c = QColor ( config. readEntry("Button", ( Qt::lightGray ). name ( ))); | 724 | QColor c = // QColor ( config. readEntry("Button", ( Qt::lightGray ). name ( ))); |
726 | if ( c == QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( )))) { | 725 | appPal. color ( QPalette::Active, QColorGroup::Button ); |
726 | if ( c == appPal. color ( QPalette::Active, QColorGroup::Background ) | ||
727 | //QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( ))) | ||
728 | ) { | ||
727 | // force button color to be different from background | 729 | // force button color to be different from background |
728 | QBrush btnBrush(QColor(200, 202, 228)); | 730 | QBrush btnBrush(QColor(200, 202, 228)); |
729 | appPal.setBrush(QColorGroup::Button, btnBrush); | 731 | appPal.setBrush(QColorGroup::Button, btnBrush); |
730 | } | 732 | } |
731 | c.hsv(&btnH, &btnS, &btnV); | 733 | c.hsv(&btnH, &btnS, &btnV); |
732 | c.light(120).hsv(&btnHoverH, &btnHoverS, &btnHoverV); | 734 | c.light(120).hsv(&btnHoverH, &btnHoverS, &btnHoverV); |
733 | 735 | ||
734 | // menu pixmap | 736 | // menu pixmap |
735 | if(!menuPix){ | 737 | if(!menuPix){ |
736 | menuPix = new QPixmap; | 738 | menuPix = new QPixmap; |
737 | menuPix->resize(64, 64); | 739 | menuPix->resize(64, 64); |
738 | } | 740 | } |
@@ -765,25 +767,25 @@ void LiquidStyle::polish(QPalette &appPal) | |||
765 | pix = smallBevelFillDict.find(c.rgb()); // better be NULL ;-) | 767 | pix = smallBevelFillDict.find(c.rgb()); // better be NULL ;-) |
766 | if(!pix){ | 768 | if(!pix){ |
767 | int h, s, v; | 769 | int h, s, v; |
768 | c.hsv(&h, &s, &v); | 770 | c.hsv(&h, &s, &v); |
769 | pix = new QPixmap(*smallBevelFillPix); | 771 | pix = new QPixmap(*smallBevelFillPix); |
770 | adjustHSV(*pix, h, s, v); | 772 | adjustHSV(*pix, h, s, v); |
771 | smallBevelFillDict.insert(c.rgb(), pix); | 773 | smallBevelFillDict.insert(c.rgb(), pix); |
772 | } | 774 | } |
773 | pagerBrush.setColor(c); | 775 | pagerBrush.setColor(c); |
774 | pagerBrush.setPixmap(*pix); | 776 | pagerBrush.setPixmap(*pix); |
775 | 777 | ||
776 | // background color stuff | 778 | // background color stuff |
777 | c = QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( ))); | 779 | c = /*QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( )));*/ appPal. color ( QPalette::Active, QColorGroup::Background ); |
778 | c.hsv(&bH, &bS, &bV); | 780 | c.hsv(&bH, &bS, &bV); |
779 | c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV); | 781 | c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV); |
780 | 782 | ||
781 | // FIXME? | 783 | // FIXME? |
782 | if(vsbSliderFillPix) | 784 | if(vsbSliderFillPix) |
783 | delete vsbSliderFillPix; | 785 | delete vsbSliderFillPix; |
784 | vsbSliderFillPix = new QPixmap(bevelFillPix->xForm(rMatrix)); | 786 | vsbSliderFillPix = new QPixmap(bevelFillPix->xForm(rMatrix)); |
785 | adjustHSV(*vsbSliderFillPix, bH, bS, bV); | 787 | adjustHSV(*vsbSliderFillPix, bH, bS, bV); |
786 | 788 | ||
787 | // background brush | 789 | // background brush |
788 | QPixmap wallPaper(32, 32); | 790 | QPixmap wallPaper(32, 32); |
789 | wallPaper.fill(c.rgb()); | 791 | wallPaper.fill(c.rgb()); |
@@ -791,50 +793,49 @@ void LiquidStyle::polish(QPalette &appPal) | |||
791 | for(i=0; i < 32; i+=4){ | 793 | for(i=0; i < 32; i+=4){ |
792 | painter.setPen(c.dark(100 + contrast)); | 794 | painter.setPen(c.dark(100 + contrast)); |
793 | painter.drawLine(0, i, 32, i); | 795 | painter.drawLine(0, i, 32, i); |
794 | painter.setPen(c.dark(100 + 3 * contrast / 5 ) ); | 796 | painter.setPen(c.dark(100 + 3 * contrast / 5 ) ); |
795 | painter.drawLine(0, i+1, 32, i+1); | 797 | painter.drawLine(0, i+1, 32, i+1); |
796 | }; | 798 | }; |
797 | painter.end(); | 799 | painter.end(); |
798 | bgBrush.setColor(c); | 800 | bgBrush.setColor(c); |
799 | bgBrush.setPixmap(wallPaper); | 801 | bgBrush.setPixmap(wallPaper); |
800 | appPal.setBrush(QColorGroup::Background, bgBrush); | 802 | appPal.setBrush(QColorGroup::Background, bgBrush); |
801 | 803 | ||
802 | // lineedits | 804 | // lineedits |
803 | c = QColor ( config. readEntry("Base", ( Qt::white). name ( ))); | 805 | c = /*QColor ( config. readEntry("Base", ( Qt::white). name ( )));*/ appPal. color ( QPalette::Active, QColorGroup::Base ); |
804 | QPixmap basePix; | 806 | QPixmap basePix; |
805 | basePix.resize(32, 32); | 807 | basePix.resize(32, 32); |
806 | basePix.fill(c.rgb()); | 808 | basePix.fill(c.rgb()); |
807 | painter.begin(&basePix); | 809 | painter.begin(&basePix); |
808 | painter.setPen(c.dark(105)); | 810 | painter.setPen(c.dark(105)); |
809 | for(i=0; i < 32; i+=4){ | 811 | for(i=0; i < 32; i+=4){ |
810 | painter.drawLine(0, i, 32, i); | 812 | painter.drawLine(0, i, 32, i); |
811 | painter.drawLine(0, i+1, 32, i+1); | 813 | painter.drawLine(0, i+1, 32, i+1); |
812 | }; | 814 | }; |
813 | painter.end(); | 815 | painter.end(); |
814 | baseBrush.setColor(c); | 816 | baseBrush.setColor(c); |
815 | baseBrush.setPixmap(basePix); | 817 | baseBrush.setPixmap(basePix); |
816 | it.toFirst(); | 818 | it.toFirst(); |
817 | while ((w=it.current()) != 0 ){ | 819 | while ((w=it.current()) != 0 ){ |
818 | ++it; | 820 | ++it; |
819 | if(w->inherits("QLineEdit")){ | 821 | if(w->inherits("QLineEdit")){ |
820 | QPalette pal = w->palette(); | 822 | QPalette pal = w->palette(); |
821 | pal.setBrush(QColorGroup::Base, baseBrush); | 823 | pal.setBrush(QColorGroup::Base, baseBrush); |
822 | w->setPalette(pal); | 824 | w->setPalette(pal); |
823 | } | 825 | } |
824 | else if(w->inherits("QPushButton")){ | 826 | else if(w->inherits("QPushButton")){ |
825 | applyCustomAttributes((QPushButton *)w); | 827 | applyCustomAttributes((QPushButton *)w); |
826 | } | 828 | } |
827 | } | 829 | } |
828 | |||
829 | } | 830 | } |
830 | 831 | ||
831 | void LiquidStyle::polish(QWidget *w) | 832 | void LiquidStyle::polish(QWidget *w) |
832 | { | 833 | { |
833 | if(w->inherits("QMenuBar")){ | 834 | if(w->inherits("QMenuBar")){ |
834 | //((QFrame*)w)->setLineWidth(0); | 835 | //((QFrame*)w)->setLineWidth(0); |
835 | w->setBackgroundMode(QWidget::PaletteBackground); | 836 | w->setBackgroundMode(QWidget::PaletteBackground); |
836 | w->setBackgroundOrigin(QWidget::ParentOrigin); | 837 | w->setBackgroundOrigin(QWidget::ParentOrigin); |
837 | return; | 838 | return; |
838 | } | 839 | } |
839 | if(w->inherits("QToolBar")){ | 840 | if(w->inherits("QToolBar")){ |
840 | w->installEventFilter(this); | 841 | w->installEventFilter(this); |
@@ -939,25 +940,25 @@ void LiquidStyle::unPolish(QWidget *w) | |||
939 | else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { | 940 | else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { |
940 | w->removeEventFilter(menuHandler); | 941 | w->removeEventFilter(menuHandler); |
941 | } | 942 | } |
942 | 943 | ||
943 | if(w->isTopLevel()) | 944 | if(w->isTopLevel()) |
944 | return; | 945 | return; |
945 | 946 | ||
946 | // for viewport children, don't just check for NoBackground.... | 947 | // for viewport children, don't just check for NoBackground.... |
947 | bool isViewportChild = w->parent() && | 948 | bool isViewportChild = w->parent() && |
948 | ((qstrcmp(w->parent()->name(), "qt_viewport") == 0) || | 949 | ((qstrcmp(w->parent()->name(), "qt_viewport") == 0) || |
949 | (qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0)); | 950 | (qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0)); |
950 | 951 | ||
951 | w->setPalette(QApplication::palette()); | 952 | w->unsetPalette(); |
952 | if(w->backgroundMode() == QWidget::X11ParentRelative || isViewportChild){ | 953 | if(w->backgroundMode() == QWidget::X11ParentRelative || isViewportChild){ |
953 | if(w->inherits("QPushButton")) | 954 | if(w->inherits("QPushButton")) |
954 | w->setBackgroundMode(QWidget::PaletteButton); | 955 | w->setBackgroundMode(QWidget::PaletteButton); |
955 | else | 956 | else |
956 | w->setBackgroundMode(QWidget::PaletteBackground); | 957 | w->setBackgroundMode(QWidget::PaletteBackground); |
957 | } | 958 | } |
958 | 959 | ||
959 | if(isViewportChild) | 960 | if(isViewportChild) |
960 | w->setAutoMask(false); | 961 | w->setAutoMask(false); |
961 | 962 | ||
962 | if(w->inherits("QPushButton")){ | 963 | if(w->inherits("QPushButton")){ |
963 | unapplyCustomAttributes((QPushButton *)w); | 964 | unapplyCustomAttributes((QPushButton *)w); |
@@ -996,39 +997,39 @@ void LiquidStyle::polish(QApplication *app) | |||
996 | menuAni = app->isEffectEnabled(UI_AnimateMenu); | 997 | menuAni = app->isEffectEnabled(UI_AnimateMenu); |
997 | menuFade = app->isEffectEnabled(UI_FadeMenu); | 998 | menuFade = app->isEffectEnabled(UI_FadeMenu); |
998 | if(menuAni) | 999 | if(menuAni) |
999 | app->setEffectEnabled(UI_AnimateMenu, false); | 1000 | app->setEffectEnabled(UI_AnimateMenu, false); |
1000 | if(menuFade) | 1001 | if(menuFade) |
1001 | app->setEffectEnabled(UI_FadeMenu, false); | 1002 | app->setEffectEnabled(UI_FadeMenu, false); |
1002 | 1003 | ||
1003 | qt_set_draw_menu_bar_impl((QDrawMenuBarItemImpl) &LiquidStyle::drawMenuBarItem); | 1004 | qt_set_draw_menu_bar_impl((QDrawMenuBarItemImpl) &LiquidStyle::drawMenuBarItem); |
1004 | 1005 | ||
1005 | Config config ( "qpe" ); | 1006 | Config config ( "qpe" ); |
1006 | config. setGroup ( "Liquid-Style" ); | 1007 | config. setGroup ( "Liquid-Style" ); |
1007 | 1008 | ||
1008 | if ( config. readBoolEntry ( "WinDecoration", true )) | 1009 | // if ( config. readBoolEntry ( "WinDecoration", true )) |
1009 | QApplication::qwsSetDecoration ( new LiquidDecoration ( )); | 1010 | // QApplication::qwsSetDecoration ( new LiquidDecoration ( )); |
1010 | 1011 | ||
1011 | flatTBButtons = config. readBoolEntry ( "FlatToolButtons", false ); | 1012 | flatTBButtons = config. readBoolEntry ( "FlatToolButtons", false ); |
1012 | } | 1013 | } |
1013 | 1014 | ||
1014 | void LiquidStyle::unPolish(QApplication *app) | 1015 | void LiquidStyle::unPolish(QApplication *app) |
1015 | { | 1016 | { |
1016 | QWindowsStyle::unPolish(app); | 1017 | QWindowsStyle::unPolish(app); |
1017 | app->setEffectEnabled(UI_AnimateMenu, menuAni); | 1018 | app->setEffectEnabled(UI_AnimateMenu, menuAni); |
1018 | app->setEffectEnabled(UI_FadeMenu, menuFade); | 1019 | app->setEffectEnabled(UI_FadeMenu, menuFade); |
1019 | 1020 | ||
1020 | qt_set_draw_menu_bar_impl ( 0 ); | 1021 | qt_set_draw_menu_bar_impl ( 0 ); |
1021 | 1022 | ||
1022 | QApplication::qwsSetDecoration ( new QPEDecoration ( )); | 1023 | // QApplication::qwsSetDecoration ( new QPEDecoration ( )); |
1023 | } | 1024 | } |
1024 | 1025 | ||
1025 | /* | 1026 | /* |
1026 | * This is a fun method ;-) Here's an overview. KToolBar grabs resize to | 1027 | * This is a fun method ;-) Here's an overview. KToolBar grabs resize to |
1027 | * force everything to erase and repaint on resize. This is going away, I'm | 1028 | * force everything to erase and repaint on resize. This is going away, I'm |
1028 | * trying to get shaped widgets to work right without masking. QPushButton, | 1029 | * trying to get shaped widgets to work right without masking. QPushButton, |
1029 | * QComboBox, and Panel applet handles capture mouse enter and leaves in order | 1030 | * QComboBox, and Panel applet handles capture mouse enter and leaves in order |
1030 | * to set the highlightwidget and repaint for mouse hovers. CheckBoxes and | 1031 | * to set the highlightwidget and repaint for mouse hovers. CheckBoxes and |
1031 | * RadioButtons need to do this differently. Qt buffers these in pixmaps and | 1032 | * RadioButtons need to do this differently. Qt buffers these in pixmaps and |
1032 | * caches them in QPixmapCache, which is bad for doing things like hover | 1033 | * caches them in QPixmapCache, which is bad for doing things like hover |
1033 | * because the style methods aren't called in paintEvents if everything | 1034 | * because the style methods aren't called in paintEvents if everything |
1034 | * is cached. We use our own Paint event handler instead. Taskbuttons and | 1035 | * is cached. We use our own Paint event handler instead. Taskbuttons and |
diff --git a/noncore/styles/liquid/opie-liquid.diff b/noncore/styles/liquid/opie-liquid.diff index 7dfd868..90ece90 100644 --- a/noncore/styles/liquid/opie-liquid.diff +++ b/noncore/styles/liquid/opie-liquid.diff | |||
@@ -1,19 +1,19 @@ | |||
1 | This is a patch to mosfet's liquid 0.7. | 1 | This is a patch to mosfet's liquid 0.7. |
2 | Features: | 2 | Features: |
3 | - Qt-only | 3 | - Qt-only |
4 | - works with Qt/E on QPE/OPIE | 4 | - works with Qt/E on QPE/OPIE |
5 | 5 | ||
6 | --- -Mon Jul 15 02:34:13 2002 | 6 | --- -Sat Sep 21 05:31:47 2002 |
7 | +++ liquid.hMon Jul 15 01:51:12 2002 | 7 | +++ liquid.hMon Jul 15 02:52:50 2002 |
8 | @@ -2,7 +2,7 @@ | 8 | @@ -2,7 +2,7 @@ |
9 | #define LIQUID_STYLE_H | 9 | #define LIQUID_STYLE_H |
10 | 10 | ||
11 | 11 | ||
12 | -#include <kstyle.h> | 12 | -#include <kstyle.h> |
13 | +#include <qwindowsstyle.h> | 13 | +#include <qwindowsstyle.h> |
14 | #include <qpainter.h> | 14 | #include <qpainter.h> |
15 | #include <qdrawutil.h> | 15 | #include <qdrawutil.h> |
16 | #include <qpalette.h> | 16 | #include <qpalette.h> |
17 | @@ -20,7 +20,7 @@ | 17 | @@ -20,7 +20,7 @@ |
18 | * Copyright (C)QPL 2001 Daniel M. Duley. All rights reserved. | 18 | * Copyright (C)QPL 2001 Daniel M. Duley. All rights reserved. |
19 | */ | 19 | */ |
@@ -101,26 +101,26 @@ Features: | |||
101 | - QPixmap *icon, QBrush *fill); | 101 | - QPixmap *icon, QBrush *fill); |
102 | // for repainting toolbuttons when the toolbar is resized | 102 | // for repainting toolbuttons when the toolbar is resized |
103 | bool eventFilter(QObject *obj, QEvent *ev); | 103 | bool eventFilter(QObject *obj, QEvent *ev); |
104 | void drawSliderGroove(QPainter * p, int x, int y, int w, int h, | 104 | void drawSliderGroove(QPainter * p, int x, int y, int w, int h, |
105 | @@ -204,6 +177,7 @@ | 105 | @@ -204,6 +177,7 @@ |
106 | QPixmap* getPixmap(BitmapData item); | 106 | QPixmap* getPixmap(BitmapData item); |
107 | QPixmap* processEmbedded(const char *label, int h, int s, int v, bool blend=false); | 107 | QPixmap* processEmbedded(const char *label, int h, int s, int v, bool blend=false); |
108 | private: | 108 | private: |
109 | +bool flatTBButtons; | 109 | +bool flatTBButtons; |
110 | bool highcolor; | 110 | bool highcolor; |
111 | QColorGroup radioOnGrp; | 111 | QColorGroup radioOnGrp; |
112 | QWidget *highlightWidget; | 112 | QWidget *highlightWidget; |
113 | --- -Mon Jul 15 02:34:13 2002 | 113 | --- -Sat Sep 21 05:31:48 2002 |
114 | +++ liquid.cppMon Jul 15 02:31:59 2002 | 114 | +++ liquid.cppSat Sep 21 05:18:54 2002 |
115 | @@ -10,12 +10,10 @@ | 115 | @@ -10,12 +10,10 @@ |
116 | 116 | ||
117 | #include <qmenudata.h> | 117 | #include <qmenudata.h> |
118 | #include "liquid.h" | 118 | #include "liquid.h" |
119 | -#include <kapp.h> | 119 | -#include <kapp.h> |
120 | -#include <kglobal.h> | 120 | -#include <kglobal.h> |
121 | -#include <kconfig.h> | 121 | -#include <kconfig.h> |
122 | -#include <kdrawutil.h> | 122 | -#include <kdrawutil.h> |
123 | -#include <kglobalsettings.h> | 123 | -#include <kglobalsettings.h> |
124 | -#include <kpixmapeffect.h> | 124 | -#include <kpixmapeffect.h> |
125 | +#include "liquiddeco.h" | 125 | +#include "liquiddeco.h" |
126 | +#include <qapplication.h> | 126 | +#include <qapplication.h> |
@@ -334,103 +334,116 @@ Features: | |||
334 | + | 334 | + |
335 | LiquidStyle::LiquidStyle() | 335 | LiquidStyle::LiquidStyle() |
336 | - :KStyle() | 336 | - :KStyle() |
337 | + :QWindowsStyle() | 337 | + :QWindowsStyle() |
338 | { | 338 | { |
339 | + setName ( "LiquidStyle" ); | 339 | + setName ( "LiquidStyle" ); |
340 | + | 340 | + |
341 | +flatTBButtons = false; | 341 | +flatTBButtons = false; |
342 | + | 342 | + |
343 | btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); | 343 | btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); |
344 | btnMaskBmp.setMask(btnMaskBmp); | 344 | btnMaskBmp.setMask(btnMaskBmp); |
345 | htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); | 345 | htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); |
346 | @@ -730,20 +704,26 @@ | 346 | @@ -711,7 +685,6 @@ |
347 | |||
348 | void LiquidStyle::polish(QPalette &appPal) | ||
349 | { | ||
350 | - | ||
351 | int i; | ||
352 | for(i=0; i < BITMAP_ITEMS; ++i){ | ||
353 | if(pixmaps[i]){ | ||
354 | @@ -730,20 +703,29 @@ | ||
347 | } | 355 | } |
348 | 356 | ||
349 | loadCustomButtons(); | 357 | loadCustomButtons(); |
350 | - lowLightVal = 100 + (2*KGlobalSettings::contrast()+4)*10; | 358 | - lowLightVal = 100 + (2*KGlobalSettings::contrast()+4)*10; |
351 | + lowLightVal = 100 + (2* /*KGlobalSettings::contrast()*/ 3 +4)*10; | 359 | + lowLightVal = 100 + (2* /*KGlobalSettings::contrast()*/ 3 +4)*10; |
352 | btnDict.clear(); | 360 | btnDict.clear(); |
353 | btnBorderDict.clear(); | 361 | btnBorderDict.clear(); |
354 | bevelFillDict.clear(); | 362 | bevelFillDict.clear(); |
355 | smallBevelFillDict.clear(); | 363 | smallBevelFillDict.clear(); |
356 | 364 | ||
357 | - KConfig *config = KGlobal::config(); | 365 | - KConfig *config = KGlobal::config(); |
358 | - QString oldGrp = config->group(); | 366 | - QString oldGrp = config->group(); |
367 | - QPalette pal = QApplication::palette(); | ||
359 | + Config config ( "qpe" ); | 368 | + Config config ( "qpe" ); |
360 | + config. setGroup ( "Liquid-Style" ); | 369 | + config. setGroup ( "Liquid-Style" ); |
361 | +int contrast = config. readNumEntry ( "StippleContrast", 5 ); | 370 | +int contrast = config. readNumEntry ( "StippleContrast", 5 ); |
362 | +if ( contrast < 0 ) | 371 | +if ( contrast < 0 ) |
363 | + contrast = 0; | 372 | + contrast = 0; |
364 | +else if ( contrast > 10 ) | 373 | +else if ( contrast > 10 ) |
365 | + contrast = 10; | 374 | + contrast = 10; |
366 | + | 375 | + |
367 | QPalette pal = QApplication::palette(); | 376 | +// QPalette pal = QApplication::palette(); |
368 | 377 | ||
369 | // button color stuff | 378 | // button color stuff |
370 | - config->setGroup("General"); | 379 | - config->setGroup("General"); |
371 | - QColor c = config->readColorEntry("buttonBackground", &Qt::lightGray); | 380 | - QColor c = config->readColorEntry("buttonBackground", &Qt::lightGray); |
372 | - if(c == config->readColorEntry("background", &Qt::lightGray)){ | 381 | - if(c == config->readColorEntry("background", &Qt::lightGray)){ |
373 | + config. setGroup ( "Appearance" ); | 382 | + config. setGroup ( "Appearance" ); |
374 | + QColor c = QColor ( config. readEntry("Button", ( Qt::lightGray ). name ( ))); | 383 | + QColor c = // QColor ( config. readEntry("Button", ( Qt::lightGray ). name ( ))); |
375 | + if ( c == QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( )))) { | 384 | + appPal. color ( QPalette::Active, QColorGroup::Button ); |
385 | + if ( c == appPal. color ( QPalette::Active, QColorGroup::Background ) | ||
386 | + //QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( ))) | ||
387 | + ) { | ||
376 | // force button color to be different from background | 388 | // force button color to be different from background |
377 | QBrush btnBrush(QColor(200, 202, 228)); | 389 | QBrush btnBrush(QColor(200, 202, 228)); |
378 | appPal.setBrush(QColorGroup::Button, btnBrush); | 390 | appPal.setBrush(QColorGroup::Button, btnBrush); |
379 | @@ -794,15 +774,7 @@ | 391 | @@ -794,15 +776,7 @@ |
380 | pagerBrush.setPixmap(*pix); | 392 | pagerBrush.setPixmap(*pix); |
381 | 393 | ||
382 | // background color stuff | 394 | // background color stuff |
383 | - c = config->readColorEntry("background", &Qt::lightGray); | 395 | - c = config->readColorEntry("background", &Qt::lightGray); |
384 | - if(qstrcmp(kapp->argv()[0], "kicker") == 0){ | 396 | - if(qstrcmp(kapp->argv()[0], "kicker") == 0){ |
385 | - appPal.setColor(QColorGroup::Mid, menuBrush.color().dark(110)); | 397 | - appPal.setColor(QColorGroup::Mid, menuBrush.color().dark(110)); |
386 | - appPal.setColor(QColorGroup::Dark, menuBrush.color().dark(130)); | 398 | - appPal.setColor(QColorGroup::Dark, menuBrush.color().dark(130)); |
387 | - appPal.setColor(QColorGroup::Midlight, menuBrush.color().light(110)); | 399 | - appPal.setColor(QColorGroup::Midlight, menuBrush.color().light(110)); |
388 | - appPal.setColor(QColorGroup::Light, menuBrush.color().light(115)); | 400 | - appPal.setColor(QColorGroup::Light, menuBrush.color().light(115)); |
389 | - menuBrush.setColor(c); // hack - used for kicker applets | 401 | - menuBrush.setColor(c); // hack - used for kicker applets |
390 | - appPal.setBrush(QColorGroup::Background, menuBrush); | 402 | - appPal.setBrush(QColorGroup::Background, menuBrush); |
391 | - } | 403 | - } |
392 | + c = QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( ))); | 404 | + c = /*QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( )));*/ appPal. color ( QPalette::Active, QColorGroup::Background ); |
393 | c.hsv(&bH, &bS, &bV); | 405 | c.hsv(&bH, &bS, &bV); |
394 | c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV); | 406 | c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV); |
395 | 407 | ||
396 | @@ -817,21 +789,18 @@ | 408 | @@ -817,21 +791,18 @@ |
397 | wallPaper.fill(c.rgb()); | 409 | wallPaper.fill(c.rgb()); |
398 | painter.begin(&wallPaper); | 410 | painter.begin(&wallPaper); |
399 | for(i=0; i < 32; i+=4){ | 411 | for(i=0; i < 32; i+=4){ |
400 | - painter.setPen(c.dark(105)); | 412 | - painter.setPen(c.dark(105)); |
401 | + painter.setPen(c.dark(100 + contrast)); | 413 | + painter.setPen(c.dark(100 + contrast)); |
402 | painter.drawLine(0, i, 32, i); | 414 | painter.drawLine(0, i, 32, i); |
403 | - painter.setPen(c.dark(103)); | 415 | - painter.setPen(c.dark(103)); |
404 | + painter.setPen(c.dark(100 + 3 * contrast / 5 ) ); | 416 | + painter.setPen(c.dark(100 + 3 * contrast / 5 ) ); |
405 | painter.drawLine(0, i+1, 32, i+1); | 417 | painter.drawLine(0, i+1, 32, i+1); |
406 | }; | 418 | }; |
407 | painter.end(); | 419 | painter.end(); |
408 | bgBrush.setColor(c); | 420 | bgBrush.setColor(c); |
409 | bgBrush.setPixmap(wallPaper); | 421 | bgBrush.setPixmap(wallPaper); |
410 | - if(qstrcmp(kapp->argv()[0], "kicker") != 0 && | 422 | - if(qstrcmp(kapp->argv()[0], "kicker") != 0 && |
411 | - qstrcmp(kapp->argv()[0], "ksplash") != 0){ | 423 | - qstrcmp(kapp->argv()[0], "ksplash") != 0){ |
412 | appPal.setBrush(QColorGroup::Background, bgBrush); | 424 | appPal.setBrush(QColorGroup::Background, bgBrush); |
413 | - } | 425 | - } |
414 | 426 | ||
415 | // lineedits | 427 | // lineedits |
416 | - c = config->readColorEntry("windowBackground", &Qt::white); | 428 | - c = config->readColorEntry("windowBackground", &Qt::white); |
417 | + c = QColor ( config. readEntry("Base", ( Qt::white). name ( ))); | 429 | + c = /*QColor ( config. readEntry("Base", ( Qt::white). name ( )));*/ appPal. color ( QPalette::Active, QColorGroup::Base ); |
418 | QPixmap basePix; | 430 | QPixmap basePix; |
419 | basePix.resize(32, 32); | 431 | basePix.resize(32, 32); |
420 | basePix.fill(c.rgb()); | 432 | basePix.fill(c.rgb()); |
421 | @@ -857,51 +826,39 @@ | 433 | @@ -856,52 +827,39 @@ |
434 | applyCustomAttributes((QPushButton *)w); | ||
422 | } | 435 | } |
423 | } | 436 | } |
424 | 437 | - | |
425 | - config->setGroup(oldGrp); | 438 | - config->setGroup(oldGrp); |
426 | } | 439 | } |
427 | 440 | ||
428 | void LiquidStyle::polish(QWidget *w) | 441 | void LiquidStyle::polish(QWidget *w) |
429 | { | 442 | { |
430 | if(w->inherits("QMenuBar")){ | 443 | if(w->inherits("QMenuBar")){ |
431 | - ((QFrame*)w)->setLineWidth(0); | 444 | - ((QFrame*)w)->setLineWidth(0); |
432 | - w->setBackgroundMode(QWidget::NoBackground); | 445 | - w->setBackgroundMode(QWidget::NoBackground); |
433 | + //((QFrame*)w)->setLineWidth(0); | 446 | + //((QFrame*)w)->setLineWidth(0); |
434 | + w->setBackgroundMode(QWidget::PaletteBackground); | 447 | + w->setBackgroundMode(QWidget::PaletteBackground); |
435 | + w->setBackgroundOrigin(QWidget::ParentOrigin); | 448 | + w->setBackgroundOrigin(QWidget::ParentOrigin); |
436 | + return; | 449 | + return; |
@@ -478,159 +491,168 @@ Features: | |||
478 | + if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame )) | 491 | + if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame )) |
479 | + w-> setBackgroundOrigin ( QWidget::ParentOrigin ); | 492 | + w-> setBackgroundOrigin ( QWidget::ParentOrigin ); |
480 | 493 | ||
481 | if(w->inherits("QComboBox") || | 494 | if(w->inherits("QComboBox") || |
482 | w->inherits("QLineEdit") || w->inherits("QRadioButton") || | 495 | w->inherits("QLineEdit") || w->inherits("QRadioButton") || |
483 | - w->inherits("QCheckBox") || w->inherits("QScrollBar") || | 496 | - w->inherits("QCheckBox") || w->inherits("QScrollBar") || |
484 | - w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || | 497 | - w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || |
485 | - w->inherits("TaskContainer")){ | 498 | - w->inherits("TaskContainer")){ |
486 | + w->inherits("QCheckBox") || w->inherits("QScrollBar")) { | 499 | + w->inherits("QCheckBox") || w->inherits("QScrollBar")) { |
487 | w->installEventFilter(this); | 500 | w->installEventFilter(this); |
488 | } | 501 | } |
489 | if(w->inherits("QLineEdit")){ | 502 | if(w->inherits("QLineEdit")){ |
490 | @@ -913,6 +870,9 @@ | 503 | @@ -913,6 +871,9 @@ |
491 | applyCustomAttributes((QPushButton *)w); | 504 | applyCustomAttributes((QPushButton *)w); |
492 | w->installEventFilter(this); | 505 | w->installEventFilter(this); |
493 | } | 506 | } |
494 | + if(w->inherits("QButton") || w-> inherits("QComboBox")){ | 507 | + if(w->inherits("QButton") || w-> inherits("QComboBox")){ |
495 | + w-> setBackgroundMode ( QWidget::PaletteBackground ); | 508 | + w-> setBackgroundMode ( QWidget::PaletteBackground ); |
496 | + } | 509 | + } |
497 | 510 | ||
498 | bool isViewport = qstrcmp(w->name(), "qt_viewport") == 0 || | 511 | bool isViewport = qstrcmp(w->name(), "qt_viewport") == 0 || |
499 | qstrcmp(w->name(), "qt_clipped_viewport") == 0; | 512 | qstrcmp(w->name(), "qt_clipped_viewport") == 0; |
500 | @@ -942,11 +902,14 @@ | 513 | @@ -942,11 +903,14 @@ |
501 | w->setMouseTracking(true); | 514 | w->setMouseTracking(true); |
502 | w->installEventFilter(this); | 515 | w->installEventFilter(this); |
503 | } | 516 | } |
504 | + if(w-> inherits("QToolButton")&&w->parent()->inherits("QToolBar")) { | 517 | + if(w-> inherits("QToolButton")&&w->parent()->inherits("QToolBar")) { |
505 | + ((QToolButton*)w)->setAutoRaise (flatTBButtons); | 518 | + ((QToolButton*)w)->setAutoRaise (flatTBButtons); |
506 | + if ( flatTBButtons ) | 519 | + if ( flatTBButtons ) |
507 | + w->setBackgroundOrigin(QWidget::ParentOrigin); | 520 | + w->setBackgroundOrigin(QWidget::ParentOrigin); |
508 | + } | 521 | + } |
509 | if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){ | 522 | if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){ |
510 | return; | 523 | return; |
511 | } | 524 | } |
512 | - if(w->inherits("PanelButtonBase")) | 525 | - if(w->inherits("PanelButtonBase")) |
513 | - return; | 526 | - return; |
514 | 527 | ||
515 | if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())-> | 528 | if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())-> |
516 | palette().active().brush(QColorGroup::Background).pixmap()){ | 529 | palette().active().brush(QColorGroup::Background).pixmap()){ |
517 | @@ -954,17 +917,13 @@ | 530 | @@ -954,17 +918,13 @@ |
518 | return; | 531 | return; |
519 | } | 532 | } |
520 | if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) && | 533 | if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) && |
521 | - !w->inherits("KDesktop") && !w->inherits("PasswordDlg")){ | 534 | - !w->inherits("KDesktop") && !w->inherits("PasswordDlg")){ |
522 | + !( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) { | 535 | + !( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) { |
523 | if(w->backgroundMode() == QWidget::PaletteBackground || | 536 | if(w->backgroundMode() == QWidget::PaletteBackground || |
524 | w->backgroundMode() == QWidget::PaletteButton){ | 537 | w->backgroundMode() == QWidget::PaletteButton){ |
525 | w->setBackgroundMode(QWidget::X11ParentRelative); | 538 | w->setBackgroundMode(QWidget::X11ParentRelative); |
526 | } | 539 | } |
527 | } | 540 | } |
528 | - if(w->inherits("KToolBar")){ | 541 | - if(w->inherits("KToolBar")){ |
529 | - w->installEventFilter(this); | 542 | - w->installEventFilter(this); |
530 | - //w->setBackgroundMode(QWidget::NoBackground); | 543 | - //w->setBackgroundMode(QWidget::NoBackground); |
531 | - return; | 544 | - return; |
532 | - } | 545 | - } |
533 | + | 546 | + |
534 | } | 547 | } |
535 | 548 | ||
536 | void LiquidStyle::unPolish(QWidget *w) | 549 | void LiquidStyle::unPolish(QWidget *w) |
537 | @@ -977,6 +936,9 @@ | 550 | @@ -977,6 +937,9 @@ |
538 | 551 | ||
539 | if(w->inherits("QPopupMenu")) | 552 | if(w->inherits("QPopupMenu")) |
540 | w->setBackgroundMode(QWidget::PaletteButton); | 553 | w->setBackgroundMode(QWidget::PaletteButton); |
541 | + else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { | 554 | + else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { |
542 | + w->removeEventFilter(menuHandler); | 555 | + w->removeEventFilter(menuHandler); |
543 | + } | 556 | + } |
544 | 557 | ||
545 | if(w->isTopLevel()) | 558 | if(w->isTopLevel()) |
546 | return; | 559 | return; |
547 | @@ -1001,12 +963,14 @@ | 560 | @@ -986,7 +949,7 @@ |
561 | ((qstrcmp(w->parent()->name(), "qt_viewport") == 0) || | ||
562 | (qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0)); | ||
563 | |||
564 | - w->setPalette(QApplication::palette()); | ||
565 | + w->unsetPalette(); | ||
566 | if(w->backgroundMode() == QWidget::X11ParentRelative || isViewportChild){ | ||
567 | if(w->inherits("QPushButton")) | ||
568 | w->setBackgroundMode(QWidget::PaletteButton); | ||
569 | @@ -1001,12 +964,14 @@ | ||
548 | unapplyCustomAttributes((QPushButton *)w); | 570 | unapplyCustomAttributes((QPushButton *)w); |
549 | w->removeEventFilter(this); | 571 | w->removeEventFilter(this); |
550 | } | 572 | } |
551 | - | 573 | - |
552 | +/* | 574 | +/* |
553 | + if(w->inherits("QPushButton") || w-> inherits("QComboBox")){ | 575 | + if(w->inherits("QPushButton") || w-> inherits("QComboBox")){ |
554 | + w-> setBackgroundMode ( PaletteBackground ); | 576 | + w-> setBackgroundMode ( PaletteBackground ); |
555 | + } | 577 | + } |
556 | +*/ | 578 | +*/ |
557 | if(w->inherits("QComboBox") || | 579 | if(w->inherits("QComboBox") || |
558 | w->inherits("QLineEdit") || w->inherits("QRadioButton") || | 580 | w->inherits("QLineEdit") || w->inherits("QRadioButton") || |
559 | - w->inherits("QCheckBox") || w->inherits("QScrollBar") || | 581 | - w->inherits("QCheckBox") || w->inherits("QScrollBar") || |
560 | - w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || | 582 | - w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || |
561 | - w->inherits("TaskContainer")){ | 583 | - w->inherits("TaskContainer")){ |
562 | + w->inherits("QCheckBox") || w->inherits("QScrollBar")) { | 584 | + w->inherits("QCheckBox") || w->inherits("QScrollBar")) { |
563 | w->removeEventFilter(this); | 585 | w->removeEventFilter(this); |
564 | } | 586 | } |
565 | if(w->inherits("QButton") || w->inherits("QComboBox")){ | 587 | if(w->inherits("QButton") || w->inherits("QComboBox")){ |
566 | @@ -1014,9 +978,9 @@ | 588 | @@ -1014,9 +979,9 @@ |
567 | w->setAutoMask(false); | 589 | w->setAutoMask(false); |
568 | } | 590 | } |
569 | } | 591 | } |
570 | - if(w->inherits("KToolBar")){ | 592 | - if(w->inherits("KToolBar")){ |
571 | + if(w->inherits("QToolBar")){ | 593 | + if(w->inherits("QToolBar")){ |
572 | w->removeEventFilter(this); | 594 | w->removeEventFilter(this); |
573 | - //w->setBackgroundMode(QWidget::PaletteBackground); | 595 | - //w->setBackgroundMode(QWidget::PaletteBackground); |
574 | + w->setBackgroundMode(QWidget::PaletteBackground); | 596 | + w->setBackgroundMode(QWidget::PaletteBackground); |
575 | return; | 597 | return; |
576 | } | 598 | } |
577 | if(w->inherits("QHeader")){ | 599 | if(w->inherits("QHeader")){ |
578 | @@ -1028,20 +992,34 @@ | 600 | @@ -1028,20 +993,34 @@ |
579 | void LiquidStyle::polish(QApplication *app) | 601 | void LiquidStyle::polish(QApplication *app) |
580 | { | 602 | { |
581 | 603 | ||
582 | - KStyle::polish(app); | 604 | - KStyle::polish(app); |
583 | + QWindowsStyle::polish(app); | 605 | + QWindowsStyle::polish(app); |
584 | menuAni = app->isEffectEnabled(UI_AnimateMenu); | 606 | menuAni = app->isEffectEnabled(UI_AnimateMenu); |
585 | menuFade = app->isEffectEnabled(UI_FadeMenu); | 607 | menuFade = app->isEffectEnabled(UI_FadeMenu); |
586 | if(menuAni) | 608 | if(menuAni) |
587 | app->setEffectEnabled(UI_AnimateMenu, false); | 609 | app->setEffectEnabled(UI_AnimateMenu, false); |
588 | if(menuFade) | 610 | if(menuFade) |
589 | app->setEffectEnabled(UI_FadeMenu, false); | 611 | app->setEffectEnabled(UI_FadeMenu, false); |
590 | + | 612 | + |
591 | + qt_set_draw_menu_bar_impl((QDrawMenuBarItemImpl) &LiquidStyle::drawMenuBarItem); | 613 | + qt_set_draw_menu_bar_impl((QDrawMenuBarItemImpl) &LiquidStyle::drawMenuBarItem); |
592 | + | 614 | + |
593 | + Config config ( "qpe" ); | 615 | + Config config ( "qpe" ); |
594 | + config. setGroup ( "Liquid-Style" ); | 616 | + config. setGroup ( "Liquid-Style" ); |
595 | + | 617 | + |
596 | + if ( config. readBoolEntry ( "WinDecoration", true )) | 618 | +// if ( config. readBoolEntry ( "WinDecoration", true )) |
597 | + QApplication::qwsSetDecoration ( new LiquidDecoration ( )); | 619 | +// QApplication::qwsSetDecoration ( new LiquidDecoration ( )); |
598 | + | 620 | + |
599 | +flatTBButtons = config. readBoolEntry ( "FlatToolButtons", false ); | 621 | +flatTBButtons = config. readBoolEntry ( "FlatToolButtons", false ); |
600 | } | 622 | } |
601 | 623 | ||
602 | void LiquidStyle::unPolish(QApplication *app) | 624 | void LiquidStyle::unPolish(QApplication *app) |
603 | { | 625 | { |
604 | - KStyle::unPolish(app); | 626 | - KStyle::unPolish(app); |
605 | + QWindowsStyle::unPolish(app); | 627 | + QWindowsStyle::unPolish(app); |
606 | app->setEffectEnabled(UI_AnimateMenu, menuAni); | 628 | app->setEffectEnabled(UI_AnimateMenu, menuAni); |
607 | app->setEffectEnabled(UI_FadeMenu, menuFade); | 629 | app->setEffectEnabled(UI_FadeMenu, menuFade); |
608 | + | 630 | + |
609 | + qt_set_draw_menu_bar_impl ( 0 ); | 631 | + qt_set_draw_menu_bar_impl ( 0 ); |
610 | + | 632 | + |
611 | + QApplication::qwsSetDecoration ( new QPEDecoration ( )); | 633 | +// QApplication::qwsSetDecoration ( new QPEDecoration ( )); |
612 | } | 634 | } |
613 | 635 | ||
614 | /* | 636 | /* |
615 | @@ -1063,7 +1041,7 @@ | 637 | @@ -1063,7 +1042,7 @@ |
616 | */ | 638 | */ |
617 | bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) | 639 | bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) |
618 | { | 640 | { |
619 | - if(obj->inherits("KToolBar")){ | 641 | - if(obj->inherits("KToolBar")){ |
620 | + if(obj->inherits("QToolBar")){ | 642 | + if(obj->inherits("QToolBar")){ |
621 | if(ev->type() == QEvent::Resize){ | 643 | if(ev->type() == QEvent::Resize){ |
622 | const QObjectList *tbChildList = obj->children(); | 644 | const QObjectList *tbChildList = obj->children(); |
623 | QObjectListIt it(*tbChildList); | 645 | QObjectListIt it(*tbChildList); |
624 | @@ -1076,35 +1054,7 @@ | 646 | @@ -1076,35 +1055,7 @@ |
625 | 647 | ||
626 | } | 648 | } |
627 | } | 649 | } |
628 | - else if(obj->inherits("KMiniPagerButton")){ | 650 | - else if(obj->inherits("KMiniPagerButton")){ |
629 | - QButton *btn = (QButton *)obj; | 651 | - QButton *btn = (QButton *)obj; |
630 | - if(ev->type() == QEvent::Paint){ | 652 | - if(ev->type() == QEvent::Paint){ |
631 | - if(!(btn->isOn() || btn->isDown())){ | 653 | - if(!(btn->isOn() || btn->isDown())){ |
632 | - QPalette pal = btn->palette(); | 654 | - QPalette pal = btn->palette(); |
633 | - pal.setBrush(QColorGroup::Dark, btn == highlightWidget ? | 655 | - pal.setBrush(QColorGroup::Dark, btn == highlightWidget ? |
634 | - pagerHoverBrush : pagerBrush); | 656 | - pagerHoverBrush : pagerBrush); |
635 | - btn->setPalette(pal); | 657 | - btn->setPalette(pal); |
636 | - } | 658 | - } |
@@ -649,167 +671,167 @@ Features: | |||
649 | - else if(ev->type() == QEvent::Leave){ | 671 | - else if(ev->type() == QEvent::Leave){ |
650 | - highlightWidget = NULL; | 672 | - highlightWidget = NULL; |
651 | - btn->repaint(false); | 673 | - btn->repaint(false); |
652 | - } | 674 | - } |
653 | - | 675 | - |
654 | - } | 676 | - } |
655 | - else if(obj->inherits("QPushButton") || obj->inherits("QComboBox") || | 677 | - else if(obj->inherits("QPushButton") || obj->inherits("QComboBox") || |
656 | - obj->isA("AppletHandle")){ | 678 | - obj->isA("AppletHandle")){ |
657 | + else if(obj->inherits("QPushButton") || obj->inherits("QComboBox")){ | 679 | + else if(obj->inherits("QPushButton") || obj->inherits("QComboBox")){ |
658 | QWidget *btn = (QWidget *)obj; | 680 | QWidget *btn = (QWidget *)obj; |
659 | if(ev->type() == QEvent::Enter){ | 681 | if(ev->type() == QEvent::Enter){ |
660 | if(btn->isEnabled()){ | 682 | if(btn->isEnabled()){ |
661 | @@ -1119,20 +1069,7 @@ | 683 | @@ -1119,20 +1070,7 @@ |
662 | } | 684 | } |
663 | } | 685 | } |
664 | } | 686 | } |
665 | - else if(obj->inherits("TaskContainer")){ | 687 | - else if(obj->inherits("TaskContainer")){ |
666 | - QButton *btn = (QButton *)obj; | 688 | - QButton *btn = (QButton *)obj; |
667 | - QPalette pal = btn->palette(); | 689 | - QPalette pal = btn->palette(); |
668 | - if(ev->type() == QEvent::Enter){ | 690 | - if(ev->type() == QEvent::Enter){ |
669 | - pal.setColor(QColorGroup::Background, pal.active().button().light(110)); | 691 | - pal.setColor(QColorGroup::Background, pal.active().button().light(110)); |
670 | - btn->setPalette(pal); | 692 | - btn->setPalette(pal); |
671 | - } | 693 | - } |
672 | - else if(ev->type() == QEvent::Leave){ | 694 | - else if(ev->type() == QEvent::Leave){ |
673 | - pal.setColor(QColorGroup::Background, | 695 | - pal.setColor(QColorGroup::Background, |
674 | - QApplication::palette().active().background()); | 696 | - QApplication::palette().active().background()); |
675 | - btn->setPalette(pal); | 697 | - btn->setPalette(pal); |
676 | - } | 698 | - } |
677 | - } | 699 | - } |
678 | - else if(obj->inherits("QToolButton") && !obj->inherits("KToolBarButton")){ | 700 | - else if(obj->inherits("QToolButton") && !obj->inherits("KToolBarButton")){ |
679 | + else if(obj->inherits("QToolButton")){ | 701 | + else if(obj->inherits("QToolButton")){ |
680 | QToolButton *btn = (QToolButton *)btn; | 702 | QToolButton *btn = (QToolButton *)btn; |
681 | if(!btn->autoRaise()){ | 703 | if(!btn->autoRaise()){ |
682 | if(btn->isEnabled()){ | 704 | if(btn->isEnabled()){ |
683 | @@ -1340,11 +1277,6 @@ | 705 | @@ -1340,11 +1278,6 @@ |
684 | QColorGroup g = btn->colorGroup(); | 706 | QColorGroup g = btn->colorGroup(); |
685 | 707 | ||
686 | 708 | ||
687 | - QColor testColor; | 709 | - QColor testColor; |
688 | - if(btn->parent() && btn->parent()->isWidgetType()){ | 710 | - if(btn->parent() && btn->parent()->isWidgetType()){ |
689 | - testColor = p->backgroundColor(); // remove me | 711 | - testColor = p->backgroundColor(); // remove me |
690 | - } | 712 | - } |
691 | - | 713 | - |
692 | //int dw = buttonDefaultIndicatorWidth(); | 714 | //int dw = buttonDefaultIndicatorWidth(); |
693 | if(btn->hasFocus() || btn->isDefault()){ | 715 | if(btn->hasFocus() || btn->isDefault()){ |
694 | QColor c = btn->hasFocus() ? g.button().light(110) : g.background(); | 716 | QColor c = btn->hasFocus() ? g.button().light(110) : g.background(); |
695 | @@ -1596,7 +1528,7 @@ | 717 | @@ -1596,7 +1529,7 @@ |
696 | if(sbBuffer.size() != sb->size()) | 718 | if(sbBuffer.size() != sb->size()) |
697 | sbBuffer.resize(sb->size()); | 719 | sbBuffer.resize(sb->size()); |
698 | } | 720 | } |
699 | - subB.setRect( subX,subY,buttonDim,buttonDim ); | 721 | - subB.setRect( subX,subY,buttonDim,buttonDim ); |
700 | + subB.setRect( subX,subY,0,0); // buttonDim,buttonDim ); | 722 | + subB.setRect( subX,subY,0,0); // buttonDim,buttonDim ); |
701 | addB.setRect( addX,addY,buttonDim,buttonDim ); | 723 | addB.setRect( addX,addY,buttonDim,buttonDim ); |
702 | if(horiz) | 724 | if(horiz) |
703 | subHC.setRect(addX-buttonDim,addY,buttonDim,buttonDim ); | 725 | subHC.setRect(addX-buttonDim,addY,buttonDim,buttonDim ); |
704 | @@ -1624,7 +1556,7 @@ | 726 | @@ -1624,7 +1557,7 @@ |
705 | QPainter painter; | 727 | QPainter painter; |
706 | if(!horiz){ | 728 | if(!horiz){ |
707 | painter.begin(&sbBuffer); | 729 | painter.begin(&sbBuffer); |
708 | - QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*3))+1); | 730 | - QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*3))+1); |
709 | + QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*2))+1); | 731 | + QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*2))+1); |
710 | if(sliderR.height() >= 8){ | 732 | if(sliderR.height() >= 8){ |
711 | painter.drawPixmap(bgR.x()+1, bgR.y(), *vsbSliderFillPix, 0, 0, | 733 | painter.drawPixmap(bgR.x()+1, bgR.y(), *vsbSliderFillPix, 0, 0, |
712 | 13, 8); | 734 | 13, 8); |
713 | @@ -1690,7 +1622,7 @@ | 735 | @@ -1690,7 +1623,7 @@ |
714 | } | 736 | } |
715 | else{ | 737 | else{ |
716 | painter.begin(&sbBuffer); | 738 | painter.begin(&sbBuffer); |
717 | - QRect bgR(subB.right()+1, 0, (len-(buttonDim*3))+1, sb->height()); | 739 | - QRect bgR(subB.right()+1, 0, (len-(buttonDim*3))+1, sb->height()); |
718 | + QRect bgR(subB.right()+1, 0, (len-(buttonDim*2))+1, sb->height()); | 740 | + QRect bgR(subB.right()+1, 0, (len-(buttonDim*2))+1, sb->height()); |
719 | if(sliderR.width() >= 8){ | 741 | if(sliderR.width() >= 8){ |
720 | painter.drawPixmap(bgR.x(), bgR.y()+1, *vsbSliderFillPix, 0, 0, | 742 | painter.drawPixmap(bgR.x(), bgR.y()+1, *vsbSliderFillPix, 0, 0, |
721 | 8, 13); | 743 | 8, 13); |
722 | @@ -1761,10 +1693,10 @@ | 744 | @@ -1761,10 +1694,10 @@ |
723 | addB.width()-8, addB.height()-8, g, !maxed); | 745 | addB.width()-8, addB.height()-8, g, !maxed); |
724 | } | 746 | } |
725 | if ( controls & SubLine ) { | 747 | if ( controls & SubLine ) { |
726 | - drawSBButton(p, subB, g, activeControl == SubLine); | 748 | - drawSBButton(p, subB, g, activeControl == SubLine); |
727 | - drawArrow( p, horiz ? LeftArrow : UpArrow, | 749 | - drawArrow( p, horiz ? LeftArrow : UpArrow, |
728 | - false, subB.x()+4, subB.y()+4, | 750 | - false, subB.x()+4, subB.y()+4, |
729 | - subB.width()-8, subB.height()-8, g, !maxed); | 751 | - subB.width()-8, subB.height()-8, g, !maxed); |
730 | + // drawSBButton(p, subB, g, activeControl == SubLine); | 752 | + // drawSBButton(p, subB, g, activeControl == SubLine); |
731 | + // drawArrow( p, horiz ? LeftArrow : UpArrow, | 753 | + // drawArrow( p, horiz ? LeftArrow : UpArrow, |
732 | + // false, subB.x()+4, subB.y()+4, | 754 | + // false, subB.x()+4, subB.y()+4, |
733 | + // subB.width()-8, subB.height()-8, g, !maxed); | 755 | + // subB.width()-8, subB.height()-8, g, !maxed); |
734 | drawSBButton(p, subHC, g, activeControl == SubLine); | 756 | drawSBButton(p, subHC, g, activeControl == SubLine); |
735 | drawArrow( p, horiz ? LeftArrow : UpArrow, | 757 | drawArrow( p, horiz ? LeftArrow : UpArrow, |
736 | false, subHC.x()+4, subHC.y()+4, | 758 | false, subHC.x()+4, subHC.y()+4, |
737 | @@ -1865,8 +1797,8 @@ | 759 | @@ -1865,8 +1798,8 @@ |
738 | else | 760 | else |
739 | buttonDim = ( length - b*2 )/2 - 1; | 761 | buttonDim = ( length - b*2 )/2 - 1; |
740 | 762 | ||
741 | - sliderMin = b + buttonDim; | 763 | - sliderMin = b + buttonDim; |
742 | - maxLength = length - b*2 - buttonDim*3; | 764 | - maxLength = length - b*2 - buttonDim*3; |
743 | + sliderMin = b + 0; // buttonDim; | 765 | + sliderMin = b + 0; // buttonDim; |
744 | + maxLength = length - b*2 - buttonDim*2; // 3; | 766 | + maxLength = length - b*2 - buttonDim*2; // 3; |
745 | 767 | ||
746 | if ( sb->maxValue() == sb->minValue() ) { | 768 | if ( sb->maxValue() == sb->minValue() ) { |
747 | sliderLength = maxLength; | 769 | sliderLength = maxLength; |
748 | @@ -1914,8 +1846,8 @@ | 770 | @@ -1914,8 +1847,8 @@ |
749 | return(QSize(16, 16)); | 771 | return(QSize(16, 16)); |
750 | } | 772 | } |
751 | 773 | ||
752 | -void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int w, | 774 | -void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int w, |
753 | - int h, const QColorGroup &g, bool on, | 775 | - int h, const QColorGroup &g, bool on, |
754 | +void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int /*w*/, | 776 | +void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int /*w*/, |
755 | + int /*h*/, const QColorGroup &/*g*/, bool on, | 777 | + int /*h*/, const QColorGroup &/*g*/, bool on, |
756 | bool down, bool) | 778 | bool down, bool) |
757 | { | 779 | { |
758 | bool isHover = highlightWidget == p->device(); | 780 | bool isHover = highlightWidget == p->device(); |
759 | @@ -1957,8 +1889,8 @@ | 781 | @@ -1957,8 +1890,8 @@ |
760 | return(QSize(20, 22)); | 782 | return(QSize(20, 22)); |
761 | } | 783 | } |
762 | 784 | ||
763 | -void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int w, int h, | 785 | -void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int w, int h, |
764 | - const QColorGroup &g, int state, bool down, bool) | 786 | - const QColorGroup &g, int state, bool down, bool) |
765 | +void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int /*w*/, int /*h*/, | 787 | +void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int /*w*/, int /*h*/, |
766 | + const QColorGroup &/*g*/, int state, bool /*down*/, bool) | 788 | + const QColorGroup &/*g*/, int state, bool /*down*/, bool) |
767 | { | 789 | { |
768 | bool isHover = highlightWidget == p->device(); | 790 | bool isHover = highlightWidget == p->device(); |
769 | bool isMasked = p->device() && p->device()->devType() == QInternal::Widget | 791 | bool isMasked = p->device() && p->device()->devType() == QInternal::Widget |
770 | @@ -1996,8 +1928,8 @@ | 792 | @@ -1996,8 +1929,8 @@ |
771 | } | 793 | } |
772 | } | 794 | } |
773 | 795 | ||
774 | -void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int w, int h, | 796 | -void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int w, int h, |
775 | - int state) | 797 | - int state) |
776 | +void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, | 798 | +void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, |
777 | + int /*state*/) | 799 | + int /*state*/) |
778 | { | 800 | { |
779 | // needed for some reason by KHtml, even tho it's all filled ;P | 801 | // needed for some reason by KHtml, even tho it's all filled ;P |
780 | p->drawPixmap(x, y, *getPixmap(HTMLCB)->mask()); | 802 | p->drawPixmap(x, y, *getPixmap(HTMLCB)->mask()); |
781 | @@ -2005,18 +1937,17 @@ | 803 | @@ -2005,18 +1938,17 @@ |
782 | } | 804 | } |
783 | 805 | ||
784 | void LiquidStyle::drawSlider(QPainter *p, int x, int y, int w, int h, | 806 | void LiquidStyle::drawSlider(QPainter *p, int x, int y, int w, int h, |
785 | - const QColorGroup &g, Orientation orient, | 807 | - const QColorGroup &g, Orientation orient, |
786 | + const QColorGroup &/*g*/, Orientation orient, | 808 | + const QColorGroup &/*g*/, Orientation orient, |
787 | bool, bool) | 809 | bool, bool) |
788 | { | 810 | { |
789 | QWidget *parent = (QWidget *)p->device(); | 811 | QWidget *parent = (QWidget *)p->device(); |
790 | p->setBrushOrigin(parent->pos()); | 812 | p->setBrushOrigin(parent->pos()); |
791 | - p->fillRect(x, y, w, h, | 813 | - p->fillRect(x, y, w, h, |
792 | - QApplication::palette().active().brush(QColorGroup::Background)); | 814 | - QApplication::palette().active().brush(QColorGroup::Background)); |
793 | + parent->erase(x, y, w, h); | 815 | + parent->erase(x, y, w, h); |
794 | p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider) : | 816 | p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider) : |
795 | *getPixmap(VSlider)); | 817 | *getPixmap(VSlider)); |
796 | } | 818 | } |
797 | 819 | ||
798 | -void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int w, int h, | 820 | -void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int w, int h, |
799 | +void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, | 821 | +void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, |
800 | Orientation orient, bool, bool) | 822 | Orientation orient, bool, bool) |
801 | { | 823 | { |
802 | p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() : | 824 | p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() : |
803 | @@ -2065,203 +1996,26 @@ | 825 | @@ -2065,203 +1997,26 @@ |
804 | p->drawLineSegments(a); | 826 | p->drawLineSegments(a); |
805 | } | 827 | } |
806 | 828 | ||
807 | -void LiquidStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h, | 829 | -void LiquidStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h, |
808 | - const QColorGroup &g, KToolBarPos, | 830 | - const QColorGroup &g, KToolBarPos, |
809 | - QBrush *) | 831 | - QBrush *) |
810 | -{ | 832 | -{ |
811 | - p->setPen(g.button().dark(120)); | 833 | - p->setPen(g.button().dark(120)); |
812 | - int x2 = x+w-1; | 834 | - int x2 = x+w-1; |
813 | - int y2 = y+h-1; | 835 | - int y2 = y+h-1; |
814 | - p->drawLine(x+1, y, x2-1, y); | 836 | - p->drawLine(x+1, y, x2-1, y); |
815 | - p->drawLine(x+1, y2, x2-1, y2); | 837 | - p->drawLine(x+1, y2, x2-1, y2); |
@@ -985,76 +1007,76 @@ Features: | |||
985 | - qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5, 0, 0, | 1007 | - qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5, 0, 0, |
986 | - g, true); | 1008 | - g, true); |
987 | - else | 1009 | - else |
988 | - qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5, | 1010 | - qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5, |
989 | - 0, 0, g, false); | 1011 | - 0, 0, g, false); |
990 | + if(active){ | 1012 | + if(active){ |
991 | + x -= 2; // Bug in Qt/E | 1013 | + x -= 2; // Bug in Qt/E |
992 | + y -= 2; | 1014 | + y -= 2; |
993 | + w += 2; | 1015 | + w += 2; |
994 | + h += 2; | 1016 | + h += 2; |
995 | } | 1017 | } |
996 | -} | 1018 | -} |
997 | - | ||
998 | 1019 | ||
1020 | - | ||
999 | -void LiquidStyle::drawKMenuItem(QPainter *p, int x, int y, int w, int h, | 1021 | -void LiquidStyle::drawKMenuItem(QPainter *p, int x, int y, int w, int h, |
1000 | - const QColorGroup &g, bool active, QMenuItem *mi, | 1022 | - const QColorGroup &g, bool active, QMenuItem *mi, |
1001 | - QBrush *) | 1023 | - QBrush *) |
1002 | -{ | 1024 | -{ |
1003 | - if ( p->font() == KGlobalSettings::generalFont() ) | 1025 | - if ( p->font() == KGlobalSettings::generalFont() ) |
1004 | - p->setFont( KGlobalSettings::menuFont() ); | 1026 | - p->setFont( KGlobalSettings::menuFont() ); |
1005 | + QWidget *parent = (QWidget *)p->device(); | 1027 | + QWidget *parent = (QWidget *)p->device(); |
1006 | + p->setBrushOrigin(parent->pos()); | 1028 | + p->setBrushOrigin(parent->pos()); |
1007 | + parent->erase(x, y, w, h); | 1029 | + parent->erase(x, y, w, h); |
1008 | 1030 | ||
1009 | if(menuHandler->useShadowText()){ | 1031 | if(menuHandler->useShadowText()){ |
1010 | QColor shadow; | 1032 | QColor shadow; |
1011 | if(p->device() && p->device()->devType() == QInternal::Widget && | 1033 | if(p->device() && p->device()->devType() == QInternal::Widget && |
1012 | - ((QWidget *)p->device())->inherits("KMenuBar")){ | 1034 | - ((QWidget *)p->device())->inherits("KMenuBar")){ |
1013 | - shadow = ((KMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : | 1035 | - shadow = ((KMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : |
1014 | + ((QWidget *)p->device())->inherits("QMenuBar")){ | 1036 | + ((QWidget *)p->device())->inherits("QMenuBar")){ |
1015 | + shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : | 1037 | + shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : |
1016 | g.background().dark(130); | 1038 | g.background().dark(130); |
1017 | } | 1039 | } |
1018 | else | 1040 | else |
1019 | @@ -2300,8 +2054,8 @@ | 1041 | @@ -2300,8 +2055,8 @@ |
1020 | } | 1042 | } |
1021 | 1043 | ||
1022 | void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h, | 1044 | void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h, |
1023 | - const QColorGroup &g, int lineWidth, | 1045 | - const QColorGroup &g, int lineWidth, |
1024 | - const QBrush * fill) | 1046 | - const QBrush * fill) |
1025 | + const QColorGroup &g, int /*lineWidth*/, | 1047 | + const QColorGroup &g, int /*lineWidth*/, |
1026 | + const QBrush * /*fill*/) | 1048 | + const QBrush * /*fill*/) |
1027 | { | 1049 | { |
1028 | QColor c; | 1050 | QColor c; |
1029 | switch(menuHandler->transType()){ | 1051 | switch(menuHandler->transType()){ |
1030 | @@ -2336,8 +2090,6 @@ | 1052 | @@ -2336,8 +2091,6 @@ |
1031 | 1053 | ||
1032 | maxpmw = QMAX( maxpmw, 20 ); | 1054 | maxpmw = QMAX( maxpmw, 20 ); |
1033 | 1055 | ||
1034 | - if ( p->font() == KGlobalSettings::generalFont() ) | 1056 | - if ( p->font() == KGlobalSettings::generalFont() ) |
1035 | - p->setFont( KGlobalSettings::menuFont() ); | 1057 | - p->setFont( KGlobalSettings::menuFont() ); |
1036 | 1058 | ||
1037 | bool dis = !enabled; | 1059 | bool dis = !enabled; |
1038 | QColorGroup itemg = dis ? pal.disabled() : pal.active(); | 1060 | QColorGroup itemg = dis ? pal.disabled() : pal.active(); |
1039 | @@ -2363,7 +2115,7 @@ | 1061 | @@ -2363,7 +2116,7 @@ |
1040 | p->fillRect(x, y, w, h, menuBrush); | 1062 | p->fillRect(x, y, w, h, menuBrush); |
1041 | } | 1063 | } |
1042 | else{ | 1064 | else{ |
1043 | - KPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); | 1065 | - KPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); |
1044 | + QPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); | 1066 | + QPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); |
1045 | if(pix) | 1067 | if(pix) |
1046 | p->drawPixmap(x, y, *pix, x, y, w, h); | 1068 | p->drawPixmap(x, y, *pix, x, y, w, h); |
1047 | } | 1069 | } |
1048 | @@ -2508,25 +2260,6 @@ | 1070 | @@ -2508,25 +2261,6 @@ |
1049 | return h; | 1071 | return h; |
1050 | } | 1072 | } |
1051 | 1073 | ||
1052 | -void LiquidStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h, | 1074 | -void LiquidStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h, |
1053 | - const QColorGroup &g, QBrush *fill) | 1075 | - const QColorGroup &g, QBrush *fill) |
1054 | -{ | 1076 | -{ |
1055 | - p->setPen(g.button().dark(130)); | 1077 | - p->setPen(g.button().dark(130)); |
1056 | - p->drawRect(x, y, w, h); | 1078 | - p->drawRect(x, y, w, h); |
1057 | - p->setPen(g.button().light(120)); | 1079 | - p->setPen(g.button().light(120)); |
1058 | - p->drawRect(x+1, y+1, w-2, h-2); | 1080 | - p->drawRect(x+1, y+1, w-2, h-2); |
1059 | - if(w >= 4 && h >= 4){ | 1081 | - if(w >= 4 && h >= 4){ |
1060 | - QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb()); | 1082 | - QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb()); |
@@ -1062,25 +1084,25 @@ Features: | |||
1062 | - int h, s, v; | 1084 | - int h, s, v; |
1063 | - g.button().dark(120).hsv(&h, &s, &v); | 1085 | - g.button().dark(120).hsv(&h, &s, &v); |
1064 | - pix = new QPixmap(*bevelFillPix); | 1086 | - pix = new QPixmap(*bevelFillPix); |
1065 | - adjustHSV(*pix, h, s, v); | 1087 | - adjustHSV(*pix, h, s, v); |
1066 | - bevelFillDict.insert(g.button().dark(120).rgb(), pix); | 1088 | - bevelFillDict.insert(g.button().dark(120).rgb(), pix); |
1067 | - } | 1089 | - } |
1068 | - p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix); | 1090 | - p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix); |
1069 | - } | 1091 | - } |
1070 | -} | 1092 | -} |
1071 | 1093 | ||
1072 | void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r, | 1094 | void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r, |
1073 | const QColorGroup &g, const QColor *c, | 1095 | const QColorGroup &g, const QColor *c, |
1074 | @@ -2540,25 +2273,25 @@ | 1096 | @@ -2540,25 +2274,25 @@ |
1075 | return; | 1097 | return; |
1076 | } | 1098 | } |
1077 | else{ | 1099 | else{ |
1078 | - KStyle::drawFocusRect(p, r, g, c, atBorder); | 1100 | - KStyle::drawFocusRect(p, r, g, c, atBorder); |
1079 | + QWindowsStyle::drawFocusRect(p, r, g, c, atBorder); | 1101 | + QWindowsStyle::drawFocusRect(p, r, g, c, atBorder); |
1080 | } | 1102 | } |
1081 | } | 1103 | } |
1082 | else | 1104 | else |
1083 | - KStyle::drawFocusRect(p, r, g, c, atBorder); | 1105 | - KStyle::drawFocusRect(p, r, g, c, atBorder); |
1084 | + QWindowsStyle::drawFocusRect(p, r, g, c, atBorder); | 1106 | + QWindowsStyle::drawFocusRect(p, r, g, c, atBorder); |
1085 | 1107 | ||
1086 | } | 1108 | } |
@@ -1092,43 +1114,43 @@ Features: | |||
1092 | + QWindowsStyle::polishPopupMenu(mnu); | 1114 | + QWindowsStyle::polishPopupMenu(mnu); |
1093 | } | 1115 | } |
1094 | 1116 | ||
1095 | void LiquidStyle::drawTab(QPainter *p, const QTabBar *tabBar, QTab *tab, | 1117 | void LiquidStyle::drawTab(QPainter *p, const QTabBar *tabBar, QTab *tab, |
1096 | bool selected) | 1118 | bool selected) |
1097 | { | 1119 | { |
1098 | if(tabBar->shape() != QTabBar::RoundedAbove){ | 1120 | if(tabBar->shape() != QTabBar::RoundedAbove){ |
1099 | - KStyle::drawTab(p, tabBar, tab, selected); | 1121 | - KStyle::drawTab(p, tabBar, tab, selected); |
1100 | + QWindowsStyle::drawTab(p, tabBar, tab, selected); | 1122 | + QWindowsStyle::drawTab(p, tabBar, tab, selected); |
1101 | return; | 1123 | return; |
1102 | } | 1124 | } |
1103 | QPixmap tilePix; | 1125 | QPixmap tilePix; |
1104 | @@ -2671,7 +2404,7 @@ | 1126 | @@ -2671,7 +2405,7 @@ |
1105 | vFrame = 8; // was 10 | 1127 | vFrame = 8; // was 10 |
1106 | } | 1128 | } |
1107 | else | 1129 | else |
1108 | - KStyle::tabbarMetrics(t, hFrame, vFrame, overlap); | 1130 | - KStyle::tabbarMetrics(t, hFrame, vFrame, overlap); |
1109 | + QWindowsStyle::tabbarMetrics(t, hFrame, vFrame, overlap); | 1131 | + QWindowsStyle::tabbarMetrics(t, hFrame, vFrame, overlap); |
1110 | } | 1132 | } |
1111 | 1133 | ||
1112 | 1134 | ||
1113 | @@ -2699,7 +2432,7 @@ | 1135 | @@ -2699,7 +2433,7 @@ |
1114 | p->drawLine(x+1, y+1, x+1, y2-1); | 1136 | p->drawLine(x+1, y+1, x+1, y2-1); |
1115 | } | 1137 | } |
1116 | else if(lineWidth != 2 || !sunken) | 1138 | else if(lineWidth != 2 || !sunken) |
1117 | - KStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); | 1139 | - KStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); |
1118 | + QWindowsStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); | 1140 | + QWindowsStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); |
1119 | else{ | 1141 | else{ |
1120 | QPen oldPen = p->pen(); | 1142 | QPen oldPen = p->pen(); |
1121 | int x2 = x+w-1; | 1143 | int x2 = x+w-1; |
1122 | @@ -2726,105 +2459,6 @@ | 1144 | @@ -2726,105 +2460,6 @@ |
1123 | } | 1145 | } |
1124 | } | 1146 | } |
1125 | 1147 | ||
1126 | -void LiquidStyle::drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h, | 1148 | -void LiquidStyle::drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h, |
1127 | - const QColorGroup &g, QBrush *) | 1149 | - const QColorGroup &g, QBrush *) |
1128 | -{ | 1150 | -{ |
1129 | - p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); | 1151 | - p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); |
1130 | - drawClearBevel(p, x, y, w, h, highlightWidget == p->device() ? | 1152 | - drawClearBevel(p, x, y, w, h, highlightWidget == p->device() ? |
1131 | - g.button().light(120) : g.button(), g.button()); | 1153 | - g.button().light(120) : g.button(), g.button()); |
1132 | - /* | 1154 | - /* |
1133 | - if(h > w){ | 1155 | - if(h > w){ |
1134 | - int y2 = y+h-1; | 1156 | - int y2 = y+h-1; |
@@ -1216,25 +1238,25 @@ Features: | |||
1216 | - } | 1238 | - } |
1217 | - | 1239 | - |
1218 | - p->setPen(g.buttonText()); | 1240 | - p->setPen(g.buttonText()); |
1219 | - | 1241 | - |
1220 | - p->drawText(br.x()+ textPos, -1, w-textPos, h, | 1242 | - p->drawText(br.x()+ textPos, -1, w-textPos, h, |
1221 | - AlignLeft|AlignVCenter, s); | 1243 | - AlignLeft|AlignVCenter, s); |
1222 | - } | 1244 | - } |
1223 | - | 1245 | - |
1224 | -} | 1246 | -} |
1225 | 1247 | ||
1226 | void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v) | 1248 | void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v) |
1227 | { | 1249 | { |
1228 | @@ -2998,22 +2632,22 @@ | 1250 | @@ -2998,22 +2633,22 @@ |
1229 | customBtnIconList.clear(); | 1251 | customBtnIconList.clear(); |
1230 | customBtnLabelList.clear(); | 1252 | customBtnLabelList.clear(); |
1231 | 1253 | ||
1232 | - KConfig *config = KGlobal::config(); | 1254 | - KConfig *config = KGlobal::config(); |
1233 | - QString oldGrp = config->group(); | 1255 | - QString oldGrp = config->group(); |
1234 | - config->setGroup("MosfetButtons"); | 1256 | - config->setGroup("MosfetButtons"); |
1235 | +// KConfig *config = KGlobal::config(); | 1257 | +// KConfig *config = KGlobal::config(); |
1236 | +// QString oldGrp = config->group(); | 1258 | +// QString oldGrp = config->group(); |
1237 | +// config->setGroup("MosfetButtons"); | 1259 | +// config->setGroup("MosfetButtons"); |
1238 | 1260 | ||
1239 | QStrList iconList, colorList; //temp, we store QPixmaps and QColors | 1261 | QStrList iconList, colorList; //temp, we store QPixmaps and QColors |
1240 | iconList.setAutoDelete(true); | 1262 | iconList.setAutoDelete(true); |
@@ -1246,52 +1268,52 @@ Features: | |||
1246 | +// config->readListEntry("Icons", iconList); | 1268 | +// config->readListEntry("Icons", iconList); |
1247 | +// config->readListEntry("Colors", colorList); | 1269 | +// config->readListEntry("Colors", colorList); |
1248 | 1270 | ||
1249 | const char *labelStr = customBtnLabelList.first(); | 1271 | const char *labelStr = customBtnLabelList.first(); |
1250 | const char *colorStr = colorList.first(); | 1272 | const char *colorStr = colorList.first(); |
1251 | const char *iconStr = iconList.first(); | 1273 | const char *iconStr = iconList.first(); |
1252 | 1274 | ||
1253 | - KIconLoader *ldr = KGlobal::iconLoader(); | 1275 | - KIconLoader *ldr = KGlobal::iconLoader(); |
1254 | +// KIconLoader *ldr = KGlobal::iconLoader(); | 1276 | +// KIconLoader *ldr = KGlobal::iconLoader(); |
1255 | while(labelStr != NULL){ | 1277 | while(labelStr != NULL){ |
1256 | QColor *c = new QColor; | 1278 | QColor *c = new QColor; |
1257 | c->setNamedColor(QString(colorStr)); | 1279 | c->setNamedColor(QString(colorStr)); |
1258 | @@ -3022,7 +2656,7 @@ | 1280 | @@ -3022,7 +2657,7 @@ |
1259 | QString tmpStr(iconStr); | 1281 | QString tmpStr(iconStr); |
1260 | if(!tmpStr.isEmpty()){ | 1282 | if(!tmpStr.isEmpty()){ |
1261 | QPixmap *pixmap = | 1283 | QPixmap *pixmap = |
1262 | - new QPixmap(ldr->loadIcon(tmpStr, KIcon::Small)); | 1284 | - new QPixmap(ldr->loadIcon(tmpStr, KIcon::Small)); |
1263 | + new QPixmap();//ldr->loadIcon(tmpStr, KIcon::Small)); | 1285 | + new QPixmap();//ldr->loadIcon(tmpStr, KIcon::Small)); |
1264 | if(pixmap->isNull()){ | 1286 | if(pixmap->isNull()){ |
1265 | delete pixmap; | 1287 | delete pixmap; |
1266 | customBtnIconList.append(NULL); | 1288 | customBtnIconList.append(NULL); |
1267 | @@ -3037,7 +2671,6 @@ | 1289 | @@ -3037,7 +2672,6 @@ |
1268 | colorStr = colorList.next(); | 1290 | colorStr = colorList.next(); |
1269 | iconStr = iconList.next(); | 1291 | iconStr = iconList.next(); |
1270 | } | 1292 | } |
1271 | - config->setGroup(oldGrp); | 1293 | - config->setGroup(oldGrp); |
1272 | } | 1294 | } |
1273 | 1295 | ||
1274 | void LiquidStyle::applyCustomAttributes(QPushButton *btn) | 1296 | void LiquidStyle::applyCustomAttributes(QPushButton *btn) |
1275 | @@ -3087,7 +2720,7 @@ | 1297 | @@ -3087,7 +2721,7 @@ |
1276 | } | 1298 | } |
1277 | } | 1299 | } |
1278 | 1300 | ||
1279 | -#include "liquid.moc" | 1301 | -#include "liquid.moc" |
1280 | +// #include "liquid.moc" | 1302 | +// #include "liquid.moc" |
1281 | 1303 | ||
1282 | 1304 | ||
1283 | 1305 | ||
1284 | --- -Mon Jul 15 02:34:13 2002 | 1306 | --- -Sat Sep 21 05:31:48 2002 |
1285 | +++ plugin.cppFri Jul 12 00:41:40 2002 | 1307 | +++ plugin.cppMon Jul 8 02:42:56 2002 |
1286 | @@ -1,29 +1,113 @@ | 1308 | @@ -1,29 +1,113 @@ |
1287 | #include "liquid.h" | 1309 | #include "liquid.h" |
1288 | -#include <klocale.h> | 1310 | -#include <klocale.h> |
1289 | +#include "liquidset.h" | 1311 | +#include "liquidset.h" |
1290 | +#include "plugin.h" | 1312 | +#include "plugin.h" |
1291 | 1313 | ||
1292 | -extern "C" { | 1314 | -extern "C" { |
1293 | - KStyle* allocate(); | 1315 | - KStyle* allocate(); |
1294 | - int minor_version(); | 1316 | - int minor_version(); |
1295 | - int major_version(); | 1317 | - int major_version(); |
1296 | - const char *description(); | 1318 | - const char *description(); |
1297 | + | 1319 | + |