summaryrefslogtreecommitdiff
authorsandman <sandman>2002-11-21 19:49:00 (UTC)
committer sandman <sandman>2002-11-21 19:49:00 (UTC)
commit440f1d4d439c83368a855355cdceda43660137f2 (patch) (unidiff)
tree1b7ffd5157d2c141b9f978d08e47699ea2d013ff
parent0b0ebb03a1fc0a316b52ce147d87fa89d3b5af16 (diff)
downloadopie-440f1d4d439c83368a855355cdceda43660137f2.zip
opie-440f1d4d439c83368a855355cdceda43660137f2.tar.gz
opie-440f1d4d439c83368a855355cdceda43660137f2.tar.bz2
- pixmaps in in menubars are now drawn (this is uncommon, but resulted in
blank icons in nethack for example) - small size optimization - updated the QPL diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/liquid/embeddata.h2
-rw-r--r--noncore/styles/liquid/liquid.cpp20
-rw-r--r--noncore/styles/liquid/opie-liquid.diff141
3 files changed, 112 insertions, 51 deletions
diff --git a/noncore/styles/liquid/embeddata.h b/noncore/styles/liquid/embeddata.h
index e4ccc27..5207fb1 100644
--- a/noncore/styles/liquid/embeddata.h
+++ b/noncore/styles/liquid/embeddata.h
@@ -928,73 +928,73 @@ static const QRgb tab_data[] = {
928 0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb, 928 0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,
929 0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb, 929 0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,
930 0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb, 930 0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,
931 0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb, 931 0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,
932 0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb, 932 0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,0xfffbfbfb,
933 0xfffbfbfb,0xfff9f9f9,0xffececec,0xff949494,0x95ababab,0xbfd5d5d5,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed, 933 0xfffbfbfb,0xfff9f9f9,0xffececec,0xff949494,0x95ababab,0xbfd5d5d5,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,
934 0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed, 934 0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,
935 0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed, 935 0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,
936 0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed, 936 0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,
937 0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed, 937 0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,
938 0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed, 938 0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,0xffededed,
939 0xffededed,0xffededed,0xffededed,0xc0d4d3d4,0x96aba9aa 939 0xffededed,0xffededed,0xffededed,0xc0d4d3d4,0x96aba9aa
940}; 940};
941 941
942static struct EmbedImage { 942static struct EmbedImage {
943 int width, height, depth; 943 int width, height, depth;
944 const unsigned char *data; 944 const unsigned char *data;
945 int numColors; 945 int numColors;
946 const QRgb *colorTable; 946 const QRgb *colorTable;
947 bool alpha; 947 bool alpha;
948 const char *name; 948 const char *name;
949} embed_image_vec[] = { 949} embed_image_vec[] = {
950 { 37, 26, 32, (const unsigned char*)buttonborder_data, 0, 0, TRUE, "buttonborder" }, 950 { 37, 26, 32, (const unsigned char*)buttonborder_data, 0, 0, TRUE, "buttonborder" },
951 { 37, 26, 32, (const unsigned char*)buttonfill_data, 0, 0, TRUE, "buttonfill" }, 951 { 37, 26, 32, (const unsigned char*)buttonfill_data, 0, 0, TRUE, "buttonfill" },
952 { 20, 22, 32, (const unsigned char*)checkbox_data, 0, 0, TRUE, "checkbox" }, 952 { 20, 22, 32, (const unsigned char*)checkbox_data, 0, 0, TRUE, "checkbox" },
953 { 20, 22, 32, (const unsigned char*)checkboxdown_data, 0, 0, TRUE, "checkboxdown" }, 953 { 20, 22, 32, (const unsigned char*)checkboxdown_data, 0, 0, TRUE, "checkboxdown" },
954 { 45, 44, 32, (const unsigned char*)clear_fill_large_data, 0, 0, TRUE, "clear_fill_large" }, 954 { 45, 44, 32, (const unsigned char*)clear_fill_large_data, 0, 0, TRUE, "clear_fill_large" },
955 { 42, 26, 32, (const unsigned char*)clear_fill_small_data, 0, 0, TRUE, "clear_fill_small" }, 955 { 42, 26, 32, (const unsigned char*)clear_fill_small_data, 0, 0, TRUE, "clear_fill_small" },
956 { 37, 26, 32, (const unsigned char*)htmlbtnborder_data, 0, 0, TRUE, "htmlbtnborder" }, 956 { 37, 26, 32, (const unsigned char*)htmlbtnborder_data, 0, 0, TRUE, "htmlbtnborder" },
957 { 20, 22, 32, (const unsigned char*)htmlcheckbox_data, 0, 0, TRUE, "htmlcheckbox" }, 957 { 20, 22, 32, (const unsigned char*)htmlcheckbox_data, 0, 0, TRUE, "htmlcheckbox" },
958 { 20, 22, 32, (const unsigned char*)htmlcheckboxdown_data, 0, 0, TRUE, "htmlcheckboxdown" }, 958 { 20, 22, 32, (const unsigned char*)htmlcheckboxdown_data, 0, 0, TRUE, "htmlcheckboxdown" },
959 { 16, 16, 32, (const unsigned char*)htmlradio_data, 0, 0, TRUE, "htmlradio" }, 959 { 16, 16, 32, (const unsigned char*)htmlradio_data, 0, 0, TRUE, "htmlradio" },
960 { 16, 16, 32, (const unsigned char*)htmlradiodown_data, 0, 0, TRUE, "htmlradiodown" }, 960 { 16, 16, 32, (const unsigned char*)htmlradiodown_data, 0, 0, TRUE, "htmlradiodown" },
961 { 16, 16, 32, (const unsigned char*)radio_data, 0, 0, TRUE, "radio" }, 961 { 16, 16, 32, (const unsigned char*)radio_data, 0, 0, TRUE, "radio" },
962 { 16, 16, 32, (const unsigned char*)radio_down_data, 0, 0, TRUE, "radio_down" }, 962 { 16, 16, 32, (const unsigned char*)radio_down_data, 0, 0, TRUE, "radio_down" },
963 { 13, 8, 32, (const unsigned char*)sbslider_btm_data, 0, 0, TRUE, "sbslider_btm" }, 963 { 13, 8, 32, (const unsigned char*)sbslider_btm_data, 0, 0, TRUE, "sbslider_btm" },
964 { 13, 28, 32, (const unsigned char*)sbslider_mid_data, 0, 0, TRUE, "sbslider_mid" }, 964 { 13, 28, 32, (const unsigned char*)sbslider_mid_data, 0, 0, TRUE, "sbslider_mid" },
965 { 13, 8, 32, (const unsigned char*)sbslider_top_data, 0, 0, TRUE, "sbslider_top" }, 965 { 13, 8, 32, (const unsigned char*)sbslider_top_data, 0, 0, TRUE, "sbslider_top" },
966 { 10, 11, 32, (const unsigned char*)sliderarrow_data, 0, 0, TRUE, "sliderarrow" }, 966 { 10, 11, 32, (const unsigned char*)sliderarrow_data, 0, 0, TRUE, "sliderarrow" },
967 { 85, 33, 32, (const unsigned char*)tab_data, 0, 0, TRUE, "tab" }, 967 { 85, 33, 32, (const unsigned char*)tab_data, 0, 0, TRUE, "tab" },
968}; 968};
969 969
970static int cmpEmbedImage(const void *a, const void *b) 970static int cmpEmbedImage(const void *a, const void *b)
971{ 971{
972 const EmbedImage* ea = (const EmbedImage*)a; 972 const EmbedImage* ea = (const EmbedImage*)a;
973 const EmbedImage* eb = (const EmbedImage*)b; 973 const EmbedImage* eb = (const EmbedImage*)b;
974 return strcmp(ea->name,eb->name); 974 return strcmp(ea->name,eb->name);
975} 975}
976inline const QImage& qembed_findImage(const char* name) 976static const QImage& qembed_findImage(const char* name)
977{ 977{
978 EmbedImage key; key.name = name; 978 EmbedImage key; key.name = name;
979 EmbedImage* r = (EmbedImage*)bsearch( &key, embed_image_vec, 979 EmbedImage* r = (EmbedImage*)bsearch( &key, embed_image_vec,
980 sizeof(embed_image_vec)/sizeof(EmbedImage), sizeof(EmbedImage), cmpEmbedImage ); 980 sizeof(embed_image_vec)/sizeof(EmbedImage), sizeof(EmbedImage), cmpEmbedImage );
981 QImage* img; 981 QImage* img;
982 if ( r ) { 982 if ( r ) {
983 img = new QImage((uchar*)r->data, 983 img = new QImage((uchar*)r->data,
984 r->width, 984 r->width,
985 r->height, 985 r->height,
986 r->depth, 986 r->depth,
987 (QRgb*)r->colorTable, 987 (QRgb*)r->colorTable,
988 r->numColors, 988 r->numColors,
989 QImage::BigEndian 989 QImage::BigEndian
990 ); 990 );
991 if ( r->alpha ) 991 if ( r->alpha )
992 img->setAlphaBuffer(TRUE); 992 img->setAlphaBuffer(TRUE);
993 } else { 993 } else {
994 static QImage dummy; 994 static QImage dummy;
995 img = &dummy; 995 img = &dummy;
996 } 996 }
997 return *img; 997 return *img;
998} 998}
999 999
1000#endif 1000#endif
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp
index ba732aa..c8f8d20 100644
--- a/noncore/styles/liquid/liquid.cpp
+++ b/noncore/styles/liquid/liquid.cpp
@@ -1960,124 +1960,134 @@ void LiquidStyle::drawArrow(QPainter *p, Qt::ArrowType type, bool on, int x,
1960 y = y + (h-8)/2; 1960 y = y + (h-8)/2;
1961 } 1961 }
1962 1962
1963 QPointArray a; 1963 QPointArray a;
1964 switch(type){ 1964 switch(type){
1965 case Qt::UpArrow: 1965 case Qt::UpArrow:
1966 a.setPoints(QCOORDARRLEN(u_arrow), u_arrow); 1966 a.setPoints(QCOORDARRLEN(u_arrow), u_arrow);
1967 break; 1967 break;
1968 case Qt::DownArrow: 1968 case Qt::DownArrow:
1969 a.setPoints(QCOORDARRLEN(d_arrow), d_arrow); 1969 a.setPoints(QCOORDARRLEN(d_arrow), d_arrow);
1970 break; 1970 break;
1971 case Qt::LeftArrow: 1971 case Qt::LeftArrow:
1972 a.setPoints(QCOORDARRLEN(l_arrow), l_arrow); 1972 a.setPoints(QCOORDARRLEN(l_arrow), l_arrow);
1973 break; 1973 break;
1974 default: 1974 default:
1975 a.setPoints(QCOORDARRLEN(r_arrow), r_arrow); 1975 a.setPoints(QCOORDARRLEN(r_arrow), r_arrow);
1976 break; 1976 break;
1977 } 1977 }
1978 1978
1979 a.translate(x, y); 1979 a.translate(x, y);
1980 p->drawLineSegments(a); 1980 p->drawLineSegments(a);
1981} 1981}
1982 1982
1983 1983
1984void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, 1984void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h,
1985 QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active ) 1985 QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active )
1986 { 1986 {
1987 if(active){ 1987 if(active){
1988 x -= 2; // Bug in Qt/E 1988 x -= 2; // Bug in Qt/E
1989 y -= 2; 1989 y -= 2;
1990 w += 2; 1990 w += 2;
1991 h += 2; 1991 h += 2;
1992 } 1992 }
1993 1993
1994 QWidget *parent = (QWidget *)p->device(); 1994 QWidget *parent = (QWidget *)p->device();
1995 p->setBrushOrigin(parent->pos()); 1995 p->setBrushOrigin(parent->pos());
1996 parent->erase(x, y, w, h); 1996 parent->erase(x, y, w, h);
1997 1997
1998 if(menuHandler->useShadowText()){ 1998 if(menuHandler->useShadowText()){
1999 QColor shadow; 1999 QColor shadow;
2000 if(p->device() && p->device()->devType() == QInternal::Widget && 2000 if(p->device() && p->device()->devType() == QInternal::Widget &&
2001 ((QWidget *)p->device())->inherits("QMenuBar")){ 2001 ((QWidget *)p->device())->inherits("QMenuBar")){
2002 shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : 2002 shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) :
2003 g.background().dark(130); 2003 g.background().dark(130);
2004 } 2004 }
2005 else 2005 else
2006 shadow = g.background().dark(130); 2006 shadow = g.background().dark(130);
2007 2007
2008 QPixmap *dummy = 0;
2009
2010 if ( mi-> pixmap ( ) && !mi-> pixmap ( )-> isNull ( )) {
2011 dummy = new QPixmap ( mi-> pixmap ( )-> size ( ));
2012 QBitmap dummy_mask ( dummy-> size ( ));
2013 dummy_mask. fill ( color1 );
2014 dummy-> setMask ( dummy_mask );
2015 }
2016
2008 if(active){ 2017 if(active){
2009 drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background()); 2018 drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background());
2010 QApplication::style().drawItem(p, x+1, y+1, w, h, 2019 QApplication::style().drawItem(p, x+1, y+1, w, h,
2011 AlignCenter|ShowPrefix|DontClip|SingleLine, 2020 AlignCenter|ShowPrefix|DontClip|SingleLine,
2012 g, mi->isEnabled(), NULL, mi->text(), 2021 g, mi->isEnabled(), dummy, mi->text(),
2013 -1, &shadow); 2022 -1, &shadow);
2014 QApplication::style().drawItem(p, x, y, w, h, 2023 QApplication::style().drawItem(p, x, y, w, h,
2015 AlignCenter|ShowPrefix|DontClip|SingleLine, 2024 AlignCenter|ShowPrefix|DontClip|SingleLine,
2016 g, mi->isEnabled(), NULL, mi->text(), 2025 g, mi->isEnabled(), mi-> pixmap ( ), mi->text(),
2017 -1, &g.text()); 2026 -1, &g.text());
2018 } 2027 }
2019 else{ 2028 else{
2020 QApplication::style().drawItem(p, x+1, y+1, w, h, 2029 QApplication::style().drawItem(p, x+1, y+1, w, h,
2021 AlignCenter|ShowPrefix|DontClip|SingleLine, 2030 AlignCenter|ShowPrefix|DontClip|SingleLine,
2022 g, mi->isEnabled(), NULL, mi->text(), 2031 g, mi->isEnabled(), dummy, mi->text(),
2023 -1, &shadow); 2032 -1, &shadow);
2024 QApplication::style().drawItem(p, x, y, w, h, 2033 QApplication::style().drawItem(p, x, y, w, h,
2025 AlignCenter|ShowPrefix|DontClip|SingleLine, 2034 AlignCenter|ShowPrefix|DontClip|SingleLine,
2026 g, mi->isEnabled(), NULL, mi->text(), 2035 g, mi->isEnabled(), mi-> pixmap ( ), mi->text(),
2027 -1, &g.text()); 2036 -1, &g.text());
2028 } 2037 }
2038 delete dummy;
2029 } 2039 }
2030 else{ 2040 else{
2031 if(active) 2041 if(active)
2032 drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background()); 2042 drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background());
2033 QApplication::style().drawItem(p, x, y, w, h, 2043 QApplication::style().drawItem(p, x, y, w, h,
2034 AlignCenter|ShowPrefix|DontClip|SingleLine, 2044 AlignCenter|ShowPrefix|DontClip|SingleLine,
2035 g, mi->isEnabled(), NULL, mi->text(), 2045 g, mi->isEnabled(), mi-> pixmap ( ), mi->text(),
2036 -1, &g.text()); 2046 -1, &g.text());
2037 } 2047 }
2038} 2048}
2039 2049
2040void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h, 2050void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h,
2041 const QColorGroup &g, int /*lineWidth*/, 2051 const QColorGroup &g, int /*lineWidth*/,
2042 const QBrush * /*fill*/) 2052 const QBrush * /*fill*/)
2043{ 2053{
2044 QColor c; 2054 QColor c;
2045 switch(menuHandler->transType()){ 2055 switch(menuHandler->transType()){
2046 case None: 2056 case None:
2047 case StippledBg: 2057 case StippledBg:
2048 case TransStippleBg: 2058 case TransStippleBg:
2049 c = g.background(); 2059 c = g.background();
2050 break; 2060 break;
2051 case StippledBtn: 2061 case StippledBtn:
2052 case TransStippleBtn: 2062 case TransStippleBtn:
2053 c = g.button(); 2063 c = g.button();
2054 break; 2064 break;
2055 default: 2065 default:
2056 c = menuHandler->bgColor(); 2066 c = menuHandler->bgColor();
2057 } 2067 }
2058 p->setPen(c.dark(140)); 2068 p->setPen(c.dark(140));
2059 p->drawRect(x, y, w, h); 2069 p->drawRect(x, y, w, h);
2060 p->setPen(c.light(120)); 2070 p->setPen(c.light(120));
2061 p->drawRect(x+1, y+1, w-2, h-2); 2071 p->drawRect(x+1, y+1, w-2, h-2);
2062} 2072}
2063 2073
2064void LiquidStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, 2074void LiquidStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw,
2065 int tab, QMenuItem* mi, 2075 int tab, QMenuItem* mi,
2066 const QPalette& pal, bool act, 2076 const QPalette& pal, bool act,
2067 bool enabled, int x, int y, int w, int h) 2077 bool enabled, int x, int y, int w, int h)
2068{ 2078{
2069static const int motifItemFrame = 2; 2079static const int motifItemFrame = 2;
2070static const int motifItemHMargin = 3; 2080static const int motifItemHMargin = 3;
2071static const int motifItemVMargin = 2; 2081static const int motifItemVMargin = 2;
2072static const int motifArrowHMargin = 6; 2082static const int motifArrowHMargin = 6;
2073static const int windowsRightBorder = 12; 2083static const int windowsRightBorder = 12;
2074 2084
2075 maxpmw = QMAX( maxpmw, 20 ); 2085 maxpmw = QMAX( maxpmw, 20 );
2076 2086
2077 2087
2078 bool dis = !enabled; 2088 bool dis = !enabled;
2079 QColorGroup itemg = dis ? pal.disabled() : pal.active(); 2089 QColorGroup itemg = dis ? pal.disabled() : pal.active();
2080 2090
2081 int checkcol = maxpmw; 2091 int checkcol = maxpmw;
2082 if(act){ 2092 if(act){
2083 2093
diff --git a/noncore/styles/liquid/opie-liquid.diff b/noncore/styles/liquid/opie-liquid.diff
index 29ae6f3..d90433c 100644
--- a/noncore/styles/liquid/opie-liquid.diff
+++ b/noncore/styles/liquid/opie-liquid.diff
@@ -1,54 +1,54 @@
1This is a patch to mosfet's liquid 0.7. 1This is a patch to mosfet's liquid 0.7.
2Features: 2Features:
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 --- -2002-11-18 04:47:41.000000000 +0100 6 --- -2002-11-21 20:45:47.000000000 +0100
7 +++ liquid.h2002-11-18 03:32:40.000000000 +0100 7 +++ liquid.h2002-11-18 03:32:40.000000000 +0100
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 */
20 20
21-class KPixmap; 21-class KPixmap;
22+class QPixmap; 22+class QPixmap;
23 23
24 #define BITMAP_ITEMS 41 24 #define BITMAP_ITEMS 41
25 #define LIQUID_MENU_CHANGE 667 25 #define LIQUID_MENU_CHANGE 667
26@@ -50,24 +50,22 @@ 26@@ -50,24 +50,22 @@
27 ~TransMenuHandler(){;} 27 ~TransMenuHandler(){;}
28 void reloadSettings(); 28 void reloadSettings();
29 int transType(){return(type);} 29 int transType(){return(type);}
30- KPixmap *pixmap(WId id){return(pixDict.find(id));} 30- KPixmap *pixmap(WId id){return(pixDict.find(id));}
31+ QPixmap *pixmap(WId id){return(pixDict.find(id));} 31+ QPixmap *pixmap(WId id){return(pixDict.find(id));}
32 const QColor& textColor(){return(fgColor);} 32 const QColor& textColor(){return(fgColor);}
33 const QColor& bgColor(){return(color);} 33 const QColor& bgColor(){return(color);}
34 bool useShadowText(){return(shadowText);} 34 bool useShadowText(){return(shadowText);}
35-protected slots: 35-protected slots:
36- void slotKIPCMessage(int id, int arg); 36- void slotKIPCMessage(int id, int arg);
37 protected: 37 protected:
38 bool eventFilter(QObject *obj, QEvent *ev); 38 bool eventFilter(QObject *obj, QEvent *ev);
39- void stripePixmap(KPixmap &pix, const QColor &color); 39- void stripePixmap(KPixmap &pix, const QColor &color);
40+ void stripePixmap(QPixmap &pix, const QColor &color); 40+ void stripePixmap(QPixmap &pix, const QColor &color);
41 41
42 QColor color, fgColor; 42 QColor color, fgColor;
43 int opacity; 43 int opacity;
44 int type; 44 int type;
45 bool shadowText; 45 bool shadowText;
46- QIntDict<KPixmap>pixDict; 46- QIntDict<KPixmap>pixDict;
47+ QIntDict<QPixmap>pixDict; 47+ QIntDict<QPixmap>pixDict;
48 }; 48 };
49 49
50-class LiquidStyle : public KStyle 50-class LiquidStyle : public KStyle
51+class LiquidStyle : public QWindowsStyle 51+class LiquidStyle : public QWindowsStyle
52 { 52 {
53 friend class TransMenuHandler; 53 friend class TransMenuHandler;
54 public: 54 public:
@@ -96,98 +96,98 @@ Features:
96- void drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h, 96- void drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h,
97- const QColorGroup &g, QBrush *); 97- const QColorGroup &g, QBrush *);
98- void drawKickerTaskButton(QPainter *p, int x, int y, int w, int h, 98- void drawKickerTaskButton(QPainter *p, int x, int y, int w, int h,
99- const QColorGroup &g, 99- const QColorGroup &g,
100- const QString &title, bool active, 100- const QString &title, bool active,
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@@ -198,25 +171,15 @@ 105@@ -198,25 +171,15 @@
106 void drawSBButton(QPainter *p, const QRect &r, const QColorGroup &g, 106 void drawSBButton(QPainter *p, const QRect &r, const QColorGroup &g,
107 bool down=false, bool fast = true); 107 bool down=false, bool fast = true);
108 void drawRoundRect(QPainter *p, int x, int y, int w, int h); 108 void drawRoundRect(QPainter *p, int x, int y, int w, int h);
109- void loadCustomButtons(); 109- void loadCustomButtons();
110- void applyCustomAttributes(QPushButton *btn); 110- void applyCustomAttributes(QPushButton *btn);
111- void unapplyCustomAttributes(QPushButton *btn); 111- void unapplyCustomAttributes(QPushButton *btn);
112 QPixmap* getPixmap(BitmapData item); 112 QPixmap* getPixmap(BitmapData item);
113 QPixmap* processEmbedded(const char *label, int h, int s, int v, bool blend=false); 113 QPixmap* processEmbedded(const char *label, int h, int s, int v, bool blend=false);
114 private: 114 private:
115- bool highcolor; 115- bool highcolor;
116- QColorGroup radioOnGrp; 116- QColorGroup radioOnGrp;
117 +bool oldqte; 117 +bool oldqte;
118 +bool flatTBButtons; 118 +bool flatTBButtons;
119 QWidget *highlightWidget; 119 QWidget *highlightWidget;
120- QBrush wallpaper; 120- QBrush wallpaper;
121- QBitmap lightBmp; 121- QBitmap lightBmp;
122- QBitmap grayBmp; 122- QBitmap grayBmp;
123- QBitmap dgrayBmp; 123- QBitmap dgrayBmp;
124- QBitmap maskBmp; 124- QBitmap maskBmp;
125- QBitmap xBmp; 125- QBitmap xBmp;
126 QBitmap btnMaskBmp, htmlBtnMaskBmp; 126 QBitmap btnMaskBmp, htmlBtnMaskBmp;
127 QPixmap *btnBorderPix, *btnBlendPix, *bevelFillPix, *smallBevelFillPix, *menuPix; 127 QPixmap *btnBorderPix, *btnBlendPix, *bevelFillPix, *smallBevelFillPix, *menuPix;
128- QBitmap paper1, paper2, paper3; 128- QBitmap paper1, paper2, paper3;
129- QBrush baseBrush, menuBrush, pagerBrush, pagerHoverBrush, bgBrush; 129- QBrush baseBrush, menuBrush, pagerBrush, pagerHoverBrush, bgBrush;
130+ QBrush bgBrush, menuBrush; 130+ QBrush bgBrush, menuBrush;
131 bool menuAni, menuFade; 131 bool menuAni, menuFade;
132 132
133 QIntDict<QPixmap>btnDict; 133 QIntDict<QPixmap>btnDict;
134@@ -224,9 +187,6 @@ 134@@ -224,9 +187,6 @@
135 QIntDict<QPixmap>bevelFillDict; 135 QIntDict<QPixmap>bevelFillDict;
136 QIntDict<QPixmap>smallBevelFillDict; 136 QIntDict<QPixmap>smallBevelFillDict;
137 137
138- QList<QColor>customBtnColorList; 138- QList<QColor>customBtnColorList;
139- QList<QPixmap>customBtnIconList; 139- QList<QPixmap>customBtnIconList;
140- QStrList customBtnLabelList; 140- QStrList customBtnLabelList;
141 QPixmap *vsbSliderFillPix; 141 QPixmap *vsbSliderFillPix;
142 TransMenuHandler *menuHandler; 142 TransMenuHandler *menuHandler;
143 QPixmap *pixmaps[BITMAP_ITEMS]; 143 QPixmap *pixmaps[BITMAP_ITEMS];
144 --- -2002-11-18 04:47:41.000000000 +0100 144 --- -2002-11-21 20:45:47.000000000 +0100
145 +++ liquid.cpp2002-11-18 04:46:13.000000000 +0100 145 +++ liquid.cpp2002-11-21 20:27:48.000000000 +0100
146@@ -2,6 +2,9 @@ 146@@ -2,6 +2,9 @@
147 * Copyright (C)QPL 2001 Daniel M. Duley. All rights reserved. 147 * Copyright (C)QPL 2001 Daniel M. Duley. All rights reserved.
148 */ 148 */
149 149
150+// 150+//
151+// (c) 2002 Robert 'sandman' Griebl 151+// (c) 2002 Robert 'sandman' Griebl
152+// 152+//
153 153
154 154
155 #ifndef INCLUDE_MENUITEM_DEF 155 #ifndef INCLUDE_MENUITEM_DEF
156@@ -10,12 +13,10 @@ 156@@ -10,12 +13,10 @@
157 157
158 #include <qmenudata.h> 158 #include <qmenudata.h>
159 #include "liquid.h" 159 #include "liquid.h"
160-#include <kapp.h> 160-#include <kapp.h>
161-#include <kglobal.h> 161-#include <kglobal.h>
162-#include <kconfig.h> 162-#include <kconfig.h>
163-#include <kdrawutil.h> 163-#include <kdrawutil.h>
164-#include <kglobalsettings.h> 164-#include <kglobalsettings.h>
165-#include <kpixmapeffect.h> 165-#include <kpixmapeffect.h>
166+//#include "liquiddeco.h" 166+//#include "liquiddeco.h"
167+#include <qapplication.h> 167+#include <qapplication.h>
168+#include <qpe/config.h> 168+#include <qpe/config.h>
169+#include "effects.h" 169+#include "effects.h"
170 #include <qpalette.h> 170 #include <qpalette.h>
171 #include <qbitmap.h> 171 #include <qbitmap.h>
172 #include <qtabbar.h> 172 #include <qtabbar.h>
173@@ -25,28 +26,30 @@ 173@@ -25,28 +26,30 @@
174 #include <qtimer.h> 174 #include <qtimer.h>
175 #include <qpixmapcache.h> 175 #include <qpixmapcache.h>
176 #include <qradiobutton.h> 176 #include <qradiobutton.h>
177-#include <kimageeffect.h> 177-#include <kimageeffect.h>
178-#include <ktoolbar.h> 178-#include <ktoolbar.h>
179+#include <qcombobox.h> 179+#include <qcombobox.h>
180 #include <qdrawutil.h> 180 #include <qdrawutil.h>
181 #include <qwidgetlist.h> 181 #include <qwidgetlist.h>
182 #include <qtoolbutton.h> 182 #include <qtoolbutton.h>
183 #include <qheader.h> 183 #include <qheader.h>
184 #include <unistd.h> 184 #include <unistd.h>
185-#include <klocale.h> 185-#include <klocale.h>
186-#include <kiconloader.h> 186-#include <kiconloader.h>
187-#include <kmenubar.h> 187-#include <kmenubar.h>
188-#include <kipc.h> 188-#include <kipc.h>
189+#include <qmenubar.h> 189+#include <qmenubar.h>
190+#include <qprogressbar.h> 190+#include <qprogressbar.h>
191+#include <qlineedit.h> 191+#include <qlineedit.h>
192 192
193-#include <X11/X.h> 193-#include <X11/X.h>
@@ -296,122 +296,122 @@ Features:
296 } 296 }
297 else if(ev->type() == QEvent::Hide){ 297 else if(ev->type() == QEvent::Hide){
298 if(type == TransStippleBg || type == TransStippleBtn || 298 if(type == TransStippleBg || type == TransStippleBtn ||
299 type == Custom){ 299 type == Custom){
300- qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width()); 300- qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width());
301- pixDict.remove(p->winId()); 301- pixDict.remove(p->winId());
302- } 302- }
303- } 303- }
304- return(false); 304- return(false);
305-} 305-}
306- 306-
307-void TransMenuHandler::slotKIPCMessage(int id, int) 307-void TransMenuHandler::slotKIPCMessage(int id, int)
308-{ 308-{
309- if(id == LIQUID_MENU_CHANGE){ 309- if(id == LIQUID_MENU_CHANGE){
310- bool oldShadow = shadowText; 310- bool oldShadow = shadowText;
311- 311-
312- KConfig *config = KGlobal::config(); 312- KConfig *config = KGlobal::config();
313- config->reparseConfiguration(); // in case KControl changed values 313- config->reparseConfiguration(); // in case KControl changed values
314+// qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width()); 314+// qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width());
315 315
316- // Make sure no popupmenus are shown. There shouldn't be any because 316- // Make sure no popupmenus are shown. There shouldn't be any because
317- // the user just clicked "Apply", but there can be tear offs ;-) 317- // the user just clicked "Apply", but there can be tear offs ;-)
318- // We just close them so the pixmaps are deleted and regenerated. 318- // We just close them so the pixmaps are deleted and regenerated.
319- QWidgetList *list = QApplication::topLevelWidgets(); 319- QWidgetList *list = QApplication::topLevelWidgets();
320- QWidgetListIt it( *list ); 320- QWidgetListIt it( *list );
321- QWidget *w; 321- QWidget *w;
322- while ((w=it.current()) != 0 ){ 322- while ((w=it.current()) != 0 ){
323- ++it; 323- ++it;
324- if(w->inherits("QPopupMenu")){ 324- if(w->inherits("QPopupMenu")){
325- w->close(); 325- w->close();
326- } 326- }
327- } 327- }
328+ pixDict.remove(p->winId()); 328+ pixDict.remove(p->winId());
329+ if ( !p->inherits("QPopupMenu")) 329+ if ( !p->inherits("QPopupMenu"))
330+ p->setBackgroundMode(QWidget::PaletteBackground); 330+ p->setBackgroundMode(QWidget::PaletteBackground);
331 331
332- reloadSettings(); 332- reloadSettings();
333 + QObjectList *ol = p-> queryList("QWidget"); 333 + QObjectList *ol = p-> queryList("QWidget");
334 + for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { 334 + for ( QObjectListIt it( *ol ); it. current ( ); ++it ) {
335 + QWidget *wid = (QWidget *) it.current ( ); 335 + QWidget *wid = (QWidget *) it.current ( );
336 336
337- // Now repaint menubar if needed 337- // Now repaint menubar if needed
338- if(shadowText != oldShadow){ 338- if(shadowText != oldShadow){
339- it.toFirst(); 339- it.toFirst();
340- while ((w=it.current()) != 0 ){ 340- while ((w=it.current()) != 0 ){
341- ++it; 341- ++it;
342- if(w->inherits("QMenuBar")){ 342- if(w->inherits("QMenuBar")){
343- w->repaint(); 343- w->repaint();
344- }
345- }
346 + wid-> setBackgroundMode( QWidget::PaletteBackground ); 344 + wid-> setBackgroundMode( QWidget::PaletteBackground );
345 }
346 + delete ol;
347 }
347 } 348 }
348- } 349- }
349- else if(id == MOSFET_BUTTON_CHANGE){ 350- else if(id == MOSFET_BUTTON_CHANGE){
350- qWarning("In mosfet button change"); 351- qWarning("In mosfet button change");
351- // really, this should be in LiquidStyle, but what the hell? ;-) 352- // really, this should be in LiquidStyle, but what the hell? ;-)
352- QWidgetList *list = QApplication::allWidgets(); 353- QWidgetList *list = QApplication::allWidgets();
353- QWidgetListIt it( *list ); 354- QWidgetListIt it( *list );
354- QWidget *w; 355- QWidget *w;
355- while ((w=it.current()) != 0 ){ 356- while ((w=it.current()) != 0 ){
356- ++it; 357- ++it;
357- if(w->inherits("QPushButton")){ 358- if(w->inherits("QPushButton")){
358- ((LiquidStyle*)parent())->unapplyCustomAttributes((QPushButton *)w); 359- ((LiquidStyle*)parent())->unapplyCustomAttributes((QPushButton *)w);
359- } 360- }
360- } 361- }
361- ((LiquidStyle*)parent())->loadCustomButtons(); 362- ((LiquidStyle*)parent())->loadCustomButtons();
362- it.toFirst(); 363- it.toFirst();
363- while ((w=it.current()) != 0 ){ 364- while ((w=it.current()) != 0 ){
364- ++it; 365- ++it;
365- if(w->inherits("QPushButton")){ 366- if(w->inherits("QPushButton")){
366- ((LiquidStyle*)parent())->applyCustomAttributes((QPushButton *)w); 367- ((LiquidStyle*)parent())->applyCustomAttributes((QPushButton *)w);
367 + delete ol; 368- }
368 } 369- }
369 }
370+ return(false); 370+ return(false);
371+} 371+}
372 372
373- } 373- }
374+ 374+
375+static int qt_version ( ) 375+static int qt_version ( )
376+{ 376+{
377 +const char *qver = qVersion ( ); 377 +const char *qver = qVersion ( );
378 +return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' ); 378 +return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' );
379 } 379 }
380 380
381+ 381+
382 LiquidStyle::LiquidStyle() 382 LiquidStyle::LiquidStyle()
383- :KStyle() 383- :KStyle()
384+ :QWindowsStyle() 384+ :QWindowsStyle()
385 { 385 {
386+ setName ( "LiquidStyle" ); 386+ setName ( "LiquidStyle" );
387+ 387+
388 +oldqte = ( qt_version ( ) < 234 ); 388 +oldqte = ( qt_version ( ) < 234 );
389 +flatTBButtons = false; 389 +flatTBButtons = false;
390+ 390+
391 btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); 391 btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true);
392 btnMaskBmp.setMask(btnMaskBmp); 392 btnMaskBmp.setMask(btnMaskBmp);
393 htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); 393 htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true);
394@@ -207,12 +191,8 @@ 394@@ -207,12 +191,8 @@
395 btnDict.setAutoDelete(true); 395 btnDict.setAutoDelete(true);
396 bevelFillDict.setAutoDelete(true); 396 bevelFillDict.setAutoDelete(true);
397 smallBevelFillDict.setAutoDelete(true); 397 smallBevelFillDict.setAutoDelete(true);
398- customBtnColorList.setAutoDelete(true); 398- customBtnColorList.setAutoDelete(true);
399- customBtnIconList.setAutoDelete(true); 399- customBtnIconList.setAutoDelete(true);
400- customBtnLabelList.setAutoDelete(true); 400- customBtnLabelList.setAutoDelete(true);
401 401
402 rMatrix.rotate(270.0); 402 rMatrix.rotate(270.0);
403- highcolor = QPixmap::defaultDepth() > 8; 403- highcolor = QPixmap::defaultDepth() > 8;
404 btnBorderPix = new QPixmap; 404 btnBorderPix = new QPixmap;
405 btnBorderPix->convertFromImage(qembed_findImage("buttonfill")); 405 btnBorderPix->convertFromImage(qembed_findImage("buttonfill"));
406 btnBlendPix = new QPixmap; 406 btnBlendPix = new QPixmap;
407@@ -572,131 +552,119 @@ 407@@ -572,131 +552,119 @@
408 case HTMLBtnBorderDown: 408 case HTMLBtnBorderDown:
409 pixmaps[HTMLBtnBorderDown] = processEmbedded("htmlbtnborder", btnHoverH, btnHoverS, btnHoverV); 409 pixmaps[HTMLBtnBorderDown] = processEmbedded("htmlbtnborder", btnHoverH, btnHoverS, btnHoverV);
410 break; 410 break;
411+ 411+
412 case HTMLCB: 412 case HTMLCB:
413 pixmaps[HTMLCB] = processEmbedded("htmlcheckbox", bH, bS, bV); 413 pixmaps[HTMLCB] = processEmbedded("htmlcheckbox", bH, bS, bV);
414 break; 414 break;
415+ case HTMLCBHover: 415+ case HTMLCBHover:
416+ pixmaps[HTMLCBHover] = processEmbedded("htmlcheckbox", btnHoverH, btnHoverS, btnHoverV); 416+ pixmaps[HTMLCBHover] = processEmbedded("htmlcheckbox", btnHoverH, btnHoverS, btnHoverV);
417+ break; 417+ break;
@@ -449,100 +449,100 @@ Features:
449+ case RadioOff: 449+ case RadioOff:
450+ pixmaps[RadioOff] = processEmbedded("radio", bH, bS, bV /*, true*/); 450+ pixmaps[RadioOff] = processEmbedded("radio", bH, bS, bV /*, true*/);
451+ break; 451+ break;
452+ case RadioOffHover: 452+ case RadioOffHover:
453+ pixmaps[RadioOffHover] = processEmbedded("radio", btnHoverH, btnHoverS, btnHoverV /*, true*/); 453+ pixmaps[RadioOffHover] = processEmbedded("radio", btnHoverH, btnHoverS, btnHoverV /*, true*/);
454+ break; 454+ break;
455 case RadioOn: 455 case RadioOn:
456- pixmaps[RadioOn] = processEmbedded("radio_down", btnH, btnS, btnV, true); 456- pixmaps[RadioOn] = processEmbedded("radio_down", btnH, btnS, btnV, true);
457+ pixmaps[RadioOn] = processEmbedded("radio_down", btnH, btnS, btnV /*, true*/); 457+ pixmaps[RadioOn] = processEmbedded("radio_down", btnH, btnS, btnV /*, true*/);
458 break; 458 break;
459 case RadioOnHover: 459 case RadioOnHover:
460- pixmaps[RadioOnHover] = processEmbedded("radio_down", btnHoverH, btnHoverS, 460- pixmaps[RadioOnHover] = processEmbedded("radio_down", btnHoverH, btnHoverS,
461- btnHoverV, true); 461- btnHoverV, true);
462+ pixmaps[RadioOnHover] = processEmbedded("radio_down", btnHoverH, btnHoverS, btnHoverV /*, true*/); 462+ pixmaps[RadioOnHover] = processEmbedded("radio_down", btnHoverH, btnHoverS, btnHoverV /*, true*/);
463 break; 463 break;
464- case RadioOffHover: 464- case RadioOffHover:
465- pixmaps[RadioOffHover] = processEmbedded("radio", btnH, btnS, btnV, true); 465- pixmaps[RadioOffHover] = processEmbedded("radio", btnH, btnS, btnV, true);
466+ 466+
467+ case Tab: 467+ case Tab:
468+ pixmaps[Tab] = processEmbedded("tab", bH, bS, bV /*, true*/); 468+ pixmaps[Tab] = processEmbedded("tab", bH, bS, bV /*, true*/);
469 break; 469 break;
470 case TabDown: 470 case TabDown:
471- pixmaps[TabDown] = processEmbedded("tab", btnH, btnS, btnV, true); 471- pixmaps[TabDown] = processEmbedded("tab", btnH, btnS, btnV, true);
472+ pixmaps[TabDown] = processEmbedded("tab", btnH, btnS, btnV /*, true*/); 472+ pixmaps[TabDown] = processEmbedded("tab", btnH, btnS, btnV /*, true*/);
473 break; 473 break;
474 case TabFocus: 474 case TabFocus:
475- pixmaps[TabFocus] = processEmbedded("tab", btnHoverH, btnHoverS, 475- pixmaps[TabFocus] = processEmbedded("tab", btnHoverH, btnHoverS,
476- btnHoverS, true); 476- btnHoverS, true);
477- break; 477- break;
478- case CBDown: 478- case CBDown:
479- pixmaps[CBDown] = processEmbedded("checkboxdown", btnH, btnS, btnV, true); 479- pixmaps[CBDown] = processEmbedded("checkboxdown", btnH, btnS, btnV, true);
480+ pixmaps[TabFocus] = processEmbedded("tab", btnHoverH, btnHoverS, btnHoverV /*, true*/); 480+ pixmaps[TabFocus] = processEmbedded("tab", btnHoverH, btnHoverS, btnHoverV /*, true*/);
481 break; 481 break;
482- case CBDownHover: 482- case CBDownHover:
483- pixmaps[CBDownHover] = processEmbedded("checkboxdown", btnHoverH, 483- pixmaps[CBDownHover] = processEmbedded("checkboxdown", btnHoverH,
484- btnHoverS, btnHoverV, true); 484- btnHoverS, btnHoverV, true);
485+ 485+
486 +case CB: 486 +case CB:
487+ pixmaps[CB] = processEmbedded("checkbox", bH, bS, bV /*, true*/); 487+ pixmaps[CB] = processEmbedded("checkbox", bH, bS, bV /*, true*/);
488 break; 488 break;
489 case CBHover: 489 case CBHover:
490- pixmaps[CBHover] = processEmbedded("checkbox", btnH, btnS, btnV, true); 490- pixmaps[CBHover] = processEmbedded("checkbox", btnH, btnS, btnV, true);
491+ pixmaps[CBHover] = processEmbedded("checkbox", btnHoverH, btnHoverS, btnHoverV /*, true*/); 491+ pixmaps[CBHover] = processEmbedded("checkbox", btnHoverH, btnHoverS, btnHoverV /*, true*/);
492 break; 492 break;
493- case HSlider: 493- case HSlider:
494- pixmaps[HSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true); 494- pixmaps[HSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true);
495+ case CBDown: 495+ case CBDown:
496+ pixmaps[CBDown] = processEmbedded("checkboxdown", btnH, btnS, btnV /*, true*/); 496+ pixmaps[CBDown] = processEmbedded("checkboxdown", btnH, btnS, btnV /*, true*/);
497 break; 497+ break;
498+ case CBDownHover: 498+ case CBDownHover:
499+ pixmaps[CBDownHover] = processEmbedded("checkboxdown", btnHoverH, btnHoverS, btnHoverV /*, true*/); 499+ pixmaps[CBDownHover] = processEmbedded("checkboxdown", btnHoverH, btnHoverS, btnHoverV /*, true*/);
500+ break; 500 break;
501+ 501+
502 case VSlider: 502 case VSlider:
503- pixmaps[VSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true); 503- pixmaps[VSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true);
504+ pixmaps[VSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true ); 504+ pixmaps[VSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true );
505 *pixmaps[VSlider] = pixmaps[VSlider]->xForm(rMatrix); 505 *pixmaps[VSlider] = pixmaps[VSlider]->xForm(rMatrix);
506 break; 506 break;
507- case RadioOff: 507- case RadioOff:
508- pixmaps[RadioOff] = processEmbedded("radio", bH, bS, bV, true); 508- pixmaps[RadioOff] = processEmbedded("radio", bH, bS, bV, true);
509- break; 509- break;
510- case Tab: 510- case Tab:
511- pixmaps[Tab] = processEmbedded("tab", bH, bS, bV, true); 511- pixmaps[Tab] = processEmbedded("tab", bH, bS, bV, true);
512- break; 512- break;
513- case CB: 513- case CB:
514- pixmaps[CB] = processEmbedded("checkbox", bH, bS, bV, true); 514- pixmaps[CB] = processEmbedded("checkbox", bH, bS, bV, true);
515- break; 515- break;
516 case VSBSliderTop: 516 case VSBSliderTop:
517- pixmaps[VSBSliderTop] = processEmbedded("sbslider_top", btnH, btnS, btnV, true); 517- pixmaps[VSBSliderTop] = processEmbedded("sbslider_top", btnH, btnS, btnV, true);
518+ case VSBSliderTopHover: 518+ case VSBSliderTopHover:
519+ pixmaps[item] = processEmbedded("sbslider_top", btnH, btnS, btnV /*, true*/); 519+ pixmaps[item] = processEmbedded("sbslider_top", btnH, btnS, btnV /*, true*/);
520 break; 520 break;
521 case VSBSliderBtm: 521 case VSBSliderBtm:
522- pixmaps[VSBSliderBtm] = processEmbedded("sbslider_btm", btnH, btnS, btnV, true); 522- pixmaps[VSBSliderBtm] = processEmbedded("sbslider_btm", btnH, btnS, btnV, true);
523+ case VSBSliderBtmHover: 523+ case VSBSliderBtmHover:
524+ pixmaps[item] = processEmbedded("sbslider_btm", btnH, btnS, btnV /*, true*/); 524+ pixmaps[item] = processEmbedded("sbslider_btm", btnH, btnS, btnV /*, true*/);
525 break; 525 break;
526 case VSBSliderMid: 526 case VSBSliderMid:
527- pixmaps[VSBSliderMid] = processEmbedded("sbslider_mid", btnH, btnS, btnV); 527- pixmaps[VSBSliderMid] = processEmbedded("sbslider_mid", btnH, btnS, btnV);
528+ case VSBSliderMidHover: 528+ case VSBSliderMidHover:
529+ pixmaps[item] = processEmbedded("sbslider_mid", btnH, btnS, btnV); 529+ pixmaps[item] = processEmbedded("sbslider_mid", btnH, btnS, btnV);
530 break; 530 break;
531- case VSBSliderTopHover: 531- case VSBSliderTopHover:
532- pixmaps[VSBSliderTopHover] = processEmbedded("sbslider_top", btnHoverH, btnHoverS, btnHoverV, true); 532- pixmaps[VSBSliderTopHover] = processEmbedded("sbslider_top", btnHoverH, btnHoverS, btnHoverV, true);
533 +case VSBSliderTopBg: 533 +case VSBSliderTopBg:
534+ pixmaps[VSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV /*, true*/); 534+ pixmaps[VSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV /*, true*/);
535 break; 535 break;
536- case VSBSliderBtmHover: 536- case VSBSliderBtmHover:
537- pixmaps[VSBSliderBtmHover] = processEmbedded("sbslider_btm", btnHoverH, btnHoverS, btnHoverV, true); 537- pixmaps[VSBSliderBtmHover] = processEmbedded("sbslider_btm", btnHoverH, btnHoverS, btnHoverV, true);
538+ case VSBSliderBtmBg: 538+ case VSBSliderBtmBg:
539+ pixmaps[VSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV /*, true*/); 539+ pixmaps[VSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV /*, true*/);
540 break; 540 break;
541- case VSBSliderMidHover: 541- case VSBSliderMidHover:
542- pixmaps[VSBSliderMidHover] = processEmbedded("sbslider_mid", btnHoverH, btnHoverS, btnHoverV); 542- pixmaps[VSBSliderMidHover] = processEmbedded("sbslider_mid", btnHoverH, btnHoverS, btnHoverV);
543+ case VSBSliderMidBg: 543+ case VSBSliderMidBg:
544+ pixmaps[VSBSliderMidBg] = processEmbedded("sbslider_mid", bH, bS, bV); 544+ pixmaps[VSBSliderMidBg] = processEmbedded("sbslider_mid", bH, bS, bV);
545 break; 545 break;
546 546
547- case HSBSliderTop: 547- case HSBSliderTop:
548- pixmaps[HSBSliderTop] = processEmbedded("sbslider_top", btnH, btnS, btnV, true); 548- pixmaps[HSBSliderTop] = processEmbedded("sbslider_top", btnH, btnS, btnV, true);
@@ -1527,160 +1527,160 @@ Features:
1527 *getPixmap(HTMLCB)); 1527 *getPixmap(HTMLCB));
1528 1528
1529 } 1529 }
1530 else{ 1530 else{
1531 if(state != QButton::Off){ 1531 if(state != QButton::Off){
1532- p->drawPixmap(x, y, isHover ? *getPixmap(CBDownHover) : 1532- p->drawPixmap(x, y, isHover ? *getPixmap(CBDownHover) :
1533+ p->drawPixmap(x, y, isActive ? *getPixmap(CBDownHover) : 1533+ p->drawPixmap(x, y, isActive ? *getPixmap(CBDownHover) :
1534 *getPixmap(CBDown)); 1534 *getPixmap(CBDown));
1535 /* Todo - tristate 1535 /* Todo - tristate
1536 if(state == QButton::On){ 1536 if(state == QButton::On){
1537@@ -1992,12 +1908,12 @@ 1537@@ -1992,12 +1908,12 @@
1538 }*/ 1538 }*/
1539 } 1539 }
1540 else 1540 else
1541- p->drawPixmap(x, y, isHover ? *getPixmap(CBHover) : *getPixmap(CB)); 1541- p->drawPixmap(x, y, isHover ? *getPixmap(CBHover) : *getPixmap(CB));
1542+ p->drawPixmap(x, y, isActive ? *getPixmap(CBHover) : *getPixmap(CB)); 1542+ p->drawPixmap(x, y, isActive ? *getPixmap(CBHover) : *getPixmap(CB));
1543 } 1543 }
1544 } 1544 }
1545 1545
1546-void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int w, int h, 1546-void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int w, int h,
1547- int state) 1547- int state)
1548+void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, 1548+void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int /*w*/, int /*h*/,
1549+ int /*state*/) 1549+ int /*state*/)
1550 { 1550 {
1551 // needed for some reason by KHtml, even tho it's all filled ;P 1551 // needed for some reason by KHtml, even tho it's all filled ;P
1552 p->drawPixmap(x, y, *getPixmap(HTMLCB)->mask()); 1552 p->drawPixmap(x, y, *getPixmap(HTMLCB)->mask());
1553@@ -2005,18 +1921,17 @@ 1553@@ -2005,18 +1921,17 @@
1554 } 1554 }
1555 1555
1556 void LiquidStyle::drawSlider(QPainter *p, int x, int y, int w, int h, 1556 void LiquidStyle::drawSlider(QPainter *p, int x, int y, int w, int h,
1557- const QColorGroup &g, Orientation orient, 1557- const QColorGroup &g, Orientation orient,
1558+ const QColorGroup &/*g*/, Orientation orient, 1558+ const QColorGroup &/*g*/, Orientation orient,
1559 bool, bool) 1559 bool, bool)
1560 { 1560 {
1561 QWidget *parent = (QWidget *)p->device(); 1561 QWidget *parent = (QWidget *)p->device();
1562 p->setBrushOrigin(parent->pos()); 1562 p->setBrushOrigin(parent->pos());
1563- p->fillRect(x, y, w, h, 1563- p->fillRect(x, y, w, h,
1564- QApplication::palette().active().brush(QColorGroup::Background)); 1564- QApplication::palette().active().brush(QColorGroup::Background));
1565+ parent->erase(x, y, w, h); 1565+ parent->erase(x, y, w, h);
1566 p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider) : 1566 p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider) :
1567 *getPixmap(VSlider)); 1567 *getPixmap(VSlider));
1568 } 1568 }
1569 1569
1570-void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int w, int h, 1570-void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int w, int h,
1571+void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, 1571+void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int /*w*/, int /*h*/,
1572 Orientation orient, bool, bool) 1572 Orientation orient, bool, bool)
1573 { 1573 {
1574 p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() : 1574 p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() :
1575@@ -2065,203 +1980,26 @@ 1575@@ -2065,243 +1980,76 @@
1576 p->drawLineSegments(a); 1576 p->drawLineSegments(a);
1577 } 1577 }
1578 1578
1579-void LiquidStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h, 1579-void LiquidStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h,
1580- const QColorGroup &g, KToolBarPos, 1580- const QColorGroup &g, KToolBarPos,
1581- QBrush *) 1581- QBrush *)
1582-{ 1582-{
1583- p->setPen(g.button().dark(120)); 1583- p->setPen(g.button().dark(120));
1584- int x2 = x+w-1; 1584- int x2 = x+w-1;
1585- int y2 = y+h-1; 1585- int y2 = y+h-1;
1586- p->drawLine(x+1, y, x2-1, y); 1586- p->drawLine(x+1, y, x2-1, y);
1587- p->drawLine(x+1, y2, x2-1, y2); 1587- p->drawLine(x+1, y2, x2-1, y2);
1588- p->drawLine(x, y+1, x, y2-1); 1588- p->drawLine(x, y+1, x, y2-1);
1589- p->drawLine(x2, y+1, x2, y2-1); 1589- p->drawLine(x2, y+1, x2, y2-1);
1590- 1590-
1591- p->setPen(g.background()); 1591- p->setPen(g.background());
1592- p->drawPoint(x, y); 1592- p->drawPoint(x, y);
1593- p->drawPoint(x2, y); 1593- p->drawPoint(x2, y);
1594- p->drawPoint(x, y2); 1594- p->drawPoint(x, y2);
1595- p->drawPoint(x2, y2); 1595- p->drawPoint(x2, y2);
1596- 1596-
1597- 1597-
1598- 1598-
1599- // p->drawRect(x, y, w, h); 1599- // p->drawRect(x, y, w, h);
1600- QPixmap *pix = bevelFillDict.find(g.button().rgb()); 1600- QPixmap *pix = bevelFillDict.find(g.button().rgb());
1601- if(!pix){ 1601- if(!pix){
1602- int h, s, v; 1602- int h, s, v;
1603- g.button().hsv(&h, &s, &v); 1603- g.button().hsv(&h, &s, &v);
1604- pix = new QPixmap(*bevelFillPix); 1604- pix = new QPixmap(*bevelFillPix);
1605- adjustHSV(*pix, h, s, v); 1605- adjustHSV(*pix, h, s, v);
1606- bevelFillDict.insert(g.button().rgb(), pix); 1606- bevelFillDict.insert(g.button().rgb(), pix);
1607- } 1607- }
1608- 1608-
1609- p->drawTiledPixmap(x+1, y+1, w-2, h-2, *pix); 1609- p->drawTiledPixmap(x+1, y+1, w-2, h-2, *pix);
1610-} 1610-}
1611- 1611-
1612-void LiquidStyle::drawKMenuBar(QPainter *p, int x, int y, int w, int h, 1612-void LiquidStyle::drawKMenuBar(QPainter *p, int x, int y, int w, int h,
1613- const QColorGroup &g, bool mac, QBrush *) 1613- const QColorGroup &g, bool mac, QBrush *)
1614-{ 1614-{
1615- if(p->device() && p->device()->devType() == QInternal::Widget && 1615- if(p->device() && p->device()->devType() == QInternal::Widget &&
1616- ((KMenuBar *)p->device())->isTopLevelMenu()){ 1616- ((KMenuBar *)p->device())->isTopLevelMenu()){
1617- p->setPen(Qt::black); 1617- p->setPen(Qt::black);
1618- p->drawRect(x, y, w, h); 1618- p->drawRect(x, y, w, h);
1619- p->drawTiledPixmap(x+1, y+1, w-2, h-2, *menuPix); 1619- p->drawTiledPixmap(x+1, y+1, w-2, h-2, *menuPix);
1620- // left 1620- // left
1621- p->drawLine(x+1, y+1, x+1, y+5); 1621- p->drawLine(x+1, y+1, x+1, y+5);
1622- p->drawLine(x+2, y+1, x+2, y+3); 1622- p->drawLine(x+2, y+1, x+2, y+3);
1623- p->drawLine(x+3, y+1, x+3, y+2); 1623- p->drawLine(x+3, y+1, x+3, y+2);
1624- p->drawLine(x+4, y+1, x+6, y+1); 1624- p->drawLine(x+4, y+1, x+6, y+1);
1625- // right 1625- // right
1626- int x2 = x+w-1; 1626- int x2 = x+w-1;
1627- p->drawLine(x2-1, y+1, x2-1, y+5); 1627- p->drawLine(x2-1, y+1, x2-1, y+5);
1628- p->drawLine(x2-2, y+1, x2-2, y+3); 1628- p->drawLine(x2-2, y+1, x2-2, y+3);
1629- p->drawLine(x2-3, y+1, x2-3, y+2); 1629- p->drawLine(x2-3, y+1, x2-3, y+2);
1630- p->drawLine(x2-4, y+1, x2-6, y+1); 1630- p->drawLine(x2-4, y+1, x2-6, y+1);
1631- } 1631- }
1632- else{ 1632- else{
1633- qDrawShadePanel(p, x, y, w, h, g, false, 1, 1633- qDrawShadePanel(p, x, y, w, h, g, false, 1,
1634- &g.brush(QColorGroup::Background)); 1634- &g.brush(QColorGroup::Background));
1635- } 1635- }
1636-
1637-}
1638 1636
1637-}
1638-
1639-void LiquidStyle::drawKToolBar(QPainter *p, int x, int y, int w, int h, 1639-void LiquidStyle::drawKToolBar(QPainter *p, int x, int y, int w, int h,
1640- const QColorGroup &g, KToolBarPos, QBrush *) 1640- const QColorGroup &g, KToolBarPos, QBrush *)
1641+void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, 1641+void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h,
1642+ QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active ) 1642+ QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active )
1643 { 1643 {
1644- //p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); 1644- //p->fillRect(x, y, w, h, g.brush(QColorGroup::Background));
1645-} 1645-}
1646- 1646-
1647-void LiquidStyle::drawKToolBarButton(QPainter *p, int x, int y, int w, int h, 1647-void LiquidStyle::drawKToolBarButton(QPainter *p, int x, int y, int w, int h,
1648- const QColorGroup &g, bool sunken, 1648- const QColorGroup &g, bool sunken,
1649- bool raised, bool enabled, bool popup, 1649- bool raised, bool enabled, bool popup,
1650- KToolButtonType icontext, 1650- KToolButtonType icontext,
1651- const QString& btext, const QPixmap *pixmap, 1651- const QString& btext, const QPixmap *pixmap,
1652- QFont *font, QWidget *btn) 1652- QFont *font, QWidget *btn)
1653-{ 1653-{
1654- int dx, dy; 1654- int dx, dy;
1655- 1655-
1656- QFontMetrics fm(*font); 1656- QFontMetrics fm(*font);
1657- 1657-
1658- QToolBar* toolbar = 0; 1658- QToolBar* toolbar = 0;
1659- if(btn->parent() && btn->parent()->isWidgetType() && btn->parent()->inherits("QToolBar")) 1659- if(btn->parent() && btn->parent()->isWidgetType() && btn->parent()->inherits("QToolBar"))
1660- toolbar = static_cast<QToolBar*>(btn->parent()); 1660- toolbar = static_cast<QToolBar*>(btn->parent());
1661- 1661-
1662- --w, --h; 1662- --w, --h;
1663- if(sunken) 1663- if(sunken)
1664- ++x, ++y; 1664- ++x, ++y;
1665- 1665-
1666- QColor btnColor(sunken ? g.button() : raised ? g.button().light(110) : 1666- QColor btnColor(sunken ? g.button() : raised ? g.button().light(110) :
1667- g.background()); 1667- g.background());
1668- drawClearBevel(p, x, y, w, h, btnColor, g.background()); 1668- drawClearBevel(p, x, y, w, h, btnColor, g.background());
1669- 1669-
1670- p->setPen(g.text()); 1670- p->setPen(g.text());
1671- 1671-
1672- if (icontext == Icon){ // icon only 1672- if (icontext == Icon){ // icon only
1673- if (pixmap){ 1673- if (pixmap){
1674- dx = ( w - pixmap->width() ) / 2; 1674- dx = ( w - pixmap->width() ) / 2;
1675- dy = ( h - pixmap->height() ) / 2; 1675- dy = ( h - pixmap->height() ) / 2;
1676- if ( sunken ) 1676- if ( sunken )
1677- { 1677- {
1678- ++dx; 1678- ++dx;
1679- ++dy; 1679- ++dy;
1680- } 1680- }
1681- p->drawPixmap( x+dx, y+dy, *pixmap ); 1681- p->drawPixmap( x+dx, y+dy, *pixmap );
1682- } 1682- }
1683- } 1683- }
1684- else if (icontext == IconTextRight){ // icon and text (if any) 1684- else if (icontext == IconTextRight){ // icon and text (if any)
1685- if (pixmap){ 1685- if (pixmap){
1686- dx = 4; 1686- dx = 4;
@@ -1743,205 +1743,251 @@ Features:
1743- dx = 2; 1743- dx = 2;
1744- if ( sunken ){ 1744- if ( sunken ){
1745- ++dx; 1745- ++dx;
1746- ++dy; 1746- ++dy;
1747- } 1747- }
1748- if (font) 1748- if (font)
1749- p->setFont(*font); 1749- p->setFont(*font);
1750- if(raised) 1750- if(raised)
1751- p->setPen(KGlobalSettings::toolBarHighlightColor()); 1751- p->setPen(KGlobalSettings::toolBarHighlightColor());
1752- p->drawText(x, y, w, h-3, tf, btext); 1752- p->drawText(x, y, w, h-3, tf, btext);
1753- } 1753- }
1754- } 1754- }
1755- if (popup){ 1755- if (popup){
1756- if (enabled) 1756- if (enabled)
1757- qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5, 0, 0, 1757- qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5, 0, 0,
1758- g, true); 1758- g, true);
1759- else 1759- else
1760- qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5, 1760- qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5,
1761- 0, 0, g, false); 1761- 0, 0, g, false);
1762+ if(active){ 1762+ if(active){
1763+ x -= 2; // Bug in Qt/E 1763+ x -= 2; // Bug in Qt/E
1764+ y -= 2; 1764+ y -= 2;
1765+ w += 2; 1765+ w += 2;
1766+ h += 2; 1766+ h += 2;
1767 } 1767 }
1768-} 1768-}
1769- 1769-
1770 1770
1771-void LiquidStyle::drawKMenuItem(QPainter *p, int x, int y, int w, int h, 1771-void LiquidStyle::drawKMenuItem(QPainter *p, int x, int y, int w, int h,
1772- const QColorGroup &g, bool active, QMenuItem *mi, 1772- const QColorGroup &g, bool active, QMenuItem *mi,
1773- QBrush *) 1773- QBrush *)
1774-{ 1774-{
1775- if ( p->font() == KGlobalSettings::generalFont() ) 1775- if ( p->font() == KGlobalSettings::generalFont() )
1776- p->setFont( KGlobalSettings::menuFont() ); 1776- p->setFont( KGlobalSettings::menuFont() );
1777+ QWidget *parent = (QWidget *)p->device(); 1777+ QWidget *parent = (QWidget *)p->device();
1778+ p->setBrushOrigin(parent->pos()); 1778+ p->setBrushOrigin(parent->pos());
1779+ parent->erase(x, y, w, h); 1779+ parent->erase(x, y, w, h);
1780 1780
1781 if(menuHandler->useShadowText()){ 1781 if(menuHandler->useShadowText()){
1782 QColor shadow; 1782 QColor shadow;
1783 if(p->device() && p->device()->devType() == QInternal::Widget && 1783 if(p->device() && p->device()->devType() == QInternal::Widget &&
1784- ((QWidget *)p->device())->inherits("KMenuBar")){ 1784- ((QWidget *)p->device())->inherits("KMenuBar")){
1785- shadow = ((KMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : 1785- shadow = ((KMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) :
1786+ ((QWidget *)p->device())->inherits("QMenuBar")){ 1786+ ((QWidget *)p->device())->inherits("QMenuBar")){
1787+ shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : 1787+ shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) :
1788 g.background().dark(130); 1788 g.background().dark(130);
1789 } 1789 }
1790 else 1790 else
1791@@ -2300,8 +2038,8 @@ 1791 shadow = g.background().dark(130);
1792
1793 + QPixmap *dummy = 0;
1794 +
1795 + if ( mi-> pixmap ( ) && !mi-> pixmap ( )-> isNull ( )) {
1796 + dummy = new QPixmap ( mi-> pixmap ( )-> size ( ));
1797 + QBitmap dummy_mask ( dummy-> size ( ));
1798 + dummy_mask. fill ( color1 );
1799 + dummy-> setMask ( dummy_mask );
1800 + }
1801+
1802 if(active){
1803 drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background());
1804 QApplication::style().drawItem(p, x+1, y+1, w, h,
1805 AlignCenter|ShowPrefix|DontClip|SingleLine,
1806- g, mi->isEnabled(), NULL, mi->text(),
1807+ g, mi->isEnabled(), dummy, mi->text(),
1808 -1, &shadow);
1809 QApplication::style().drawItem(p, x, y, w, h,
1810 AlignCenter|ShowPrefix|DontClip|SingleLine,
1811- g, mi->isEnabled(), NULL, mi->text(),
1812+ g, mi->isEnabled(), mi-> pixmap ( ), mi->text(),
1813 -1, &g.text());
1814 }
1815 else{
1816 QApplication::style().drawItem(p, x+1, y+1, w, h,
1817 AlignCenter|ShowPrefix|DontClip|SingleLine,
1818- g, mi->isEnabled(), NULL, mi->text(),
1819+ g, mi->isEnabled(), dummy, mi->text(),
1820 -1, &shadow);
1821 QApplication::style().drawItem(p, x, y, w, h,
1822 AlignCenter|ShowPrefix|DontClip|SingleLine,
1823- g, mi->isEnabled(), NULL, mi->text(),
1824+ g, mi->isEnabled(), mi-> pixmap ( ), mi->text(),
1825 -1, &g.text());
1826 }
1827+ delete dummy;
1828 }
1829 else{
1830 if(active)
1831 drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background());
1832 QApplication::style().drawItem(p, x, y, w, h,
1833 AlignCenter|ShowPrefix|DontClip|SingleLine,
1834- g, mi->isEnabled(), NULL, mi->text(),
1835+ g, mi->isEnabled(), mi-> pixmap ( ), mi->text(),
1836 -1, &g.text());
1837 }
1792 } 1838 }
1793 1839
1794 void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h, 1840 void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h,
1795- const QColorGroup &g, int lineWidth, 1841- const QColorGroup &g, int lineWidth,
1796- const QBrush * fill) 1842- const QBrush * fill)
1797+ const QColorGroup &g, int /*lineWidth*/, 1843+ const QColorGroup &g, int /*lineWidth*/,
1798+ const QBrush * /*fill*/) 1844+ const QBrush * /*fill*/)
1799 { 1845 {
1800 QColor c; 1846 QColor c;
1801 switch(menuHandler->transType()){ 1847 switch(menuHandler->transType()){
1802@@ -2336,8 +2074,6 @@ 1848@@ -2336,8 +2084,6 @@
1803 1849
1804 maxpmw = QMAX( maxpmw, 20 ); 1850 maxpmw = QMAX( maxpmw, 20 );
1805 1851
1806- if ( p->font() == KGlobalSettings::generalFont() ) 1852- if ( p->font() == KGlobalSettings::generalFont() )
1807- p->setFont( KGlobalSettings::menuFont() ); 1853- p->setFont( KGlobalSettings::menuFont() );
1808 1854
1809 bool dis = !enabled; 1855 bool dis = !enabled;
1810 QColorGroup itemg = dis ? pal.disabled() : pal.active(); 1856 QColorGroup itemg = dis ? pal.disabled() : pal.active();
1811@@ -2363,7 +2099,7 @@ 1857@@ -2363,7 +2109,7 @@
1812 p->fillRect(x, y, w, h, menuBrush); 1858 p->fillRect(x, y, w, h, menuBrush);
1813 } 1859 }
1814 else{ 1860 else{
1815- KPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); 1861- KPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId());
1816+ QPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); 1862+ QPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId());
1817 if(pix) 1863 if(pix)
1818 p->drawPixmap(x, y, *pix, x, y, w, h); 1864 p->drawPixmap(x, y, *pix, x, y, w, h);
1819 } 1865 }
1820@@ -2508,25 +2244,6 @@ 1866@@ -2508,25 +2254,6 @@
1821 return h; 1867 return h;
1822 } 1868 }
1823 1869
1824-void LiquidStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h, 1870-void LiquidStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h,
1825- const QColorGroup &g, QBrush *fill) 1871- const QColorGroup &g, QBrush *fill)
1826-{ 1872-{
1827- p->setPen(g.button().dark(130)); 1873- p->setPen(g.button().dark(130));
1828- p->drawRect(x, y, w, h); 1874- p->drawRect(x, y, w, h);
1829- p->setPen(g.button().light(120)); 1875- p->setPen(g.button().light(120));
1830- p->drawRect(x+1, y+1, w-2, h-2); 1876- p->drawRect(x+1, y+1, w-2, h-2);
1831- if(w >= 4 && h >= 4){ 1877- if(w >= 4 && h >= 4){
1832- QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb()); 1878- QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb());
1833- if(!pix){ 1879- if(!pix){
1834- int h, s, v; 1880- int h, s, v;
1835- g.button().dark(120).hsv(&h, &s, &v); 1881- g.button().dark(120).hsv(&h, &s, &v);
1836- pix = new QPixmap(*bevelFillPix); 1882- pix = new QPixmap(*bevelFillPix);
1837- adjustHSV(*pix, h, s, v); 1883- adjustHSV(*pix, h, s, v);
1838- bevelFillDict.insert(g.button().dark(120).rgb(), pix); 1884- bevelFillDict.insert(g.button().dark(120).rgb(), pix);
1839- } 1885- }
1840- p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix); 1886- p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix);
1841- } 1887- }
1842-} 1888-}
1843 1889
1844 void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r, 1890 void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r,
1845 const QColorGroup &g, const QColor *c, 1891 const QColorGroup &g, const QColor *c,
1846@@ -2536,29 +2253,29 @@ 1892@@ -2536,29 +2263,29 @@
1847 if(p->device()->devType() == QInternal::Widget){ 1893 if(p->device()->devType() == QInternal::Widget){
1848 // if so does it use a special focus rectangle? 1894 // if so does it use a special focus rectangle?
1849 QWidget *w = (QWidget *)p->device(); 1895 QWidget *w = (QWidget *)p->device();
1850- if(w->inherits("QPushButton") || w->inherits("QSlider")){ 1896- if(w->inherits("QPushButton") || w->inherits("QSlider")){
1851+ if(w->inherits("QPushButton") || w->inherits("QSlider") || w->inherits("QComboBox") || w->inherits("QToolButton" )){ 1897+ if(w->inherits("QPushButton") || w->inherits("QSlider") || w->inherits("QComboBox") || w->inherits("QToolButton" )){
1852 return; 1898 return;
1853 } 1899 }
1854 else{ 1900 else{
1855- KStyle::drawFocusRect(p, r, g, c, atBorder); 1901- KStyle::drawFocusRect(p, r, g, c, atBorder);
1856+ QWindowsStyle::drawFocusRect(p, r, g, c, atBorder); 1902+ QWindowsStyle::drawFocusRect(p, r, g, c, atBorder);
1857 } 1903 }
1858 } 1904 }
1859 else 1905 else
1860- KStyle::drawFocusRect(p, r, g, c, atBorder); 1906- KStyle::drawFocusRect(p, r, g, c, atBorder);
1861+ QWindowsStyle::drawFocusRect(p, r, g, c, atBorder); 1907+ QWindowsStyle::drawFocusRect(p, r, g, c, atBorder);
1862 1908
1863 } 1909 }
1864 1910
1865 void LiquidStyle::polishPopupMenu(QPopupMenu *mnu) 1911 void LiquidStyle::polishPopupMenu(QPopupMenu *mnu)
1866 { 1912 {
1867 mnu->installEventFilter(menuHandler); 1913 mnu->installEventFilter(menuHandler);
1868- KStyle::polishPopupMenu(mnu); 1914- KStyle::polishPopupMenu(mnu);
1869+ QWindowsStyle::polishPopupMenu(mnu); 1915+ QWindowsStyle::polishPopupMenu(mnu);
1870 } 1916 }
1871 1917
1872 void LiquidStyle::drawTab(QPainter *p, const QTabBar *tabBar, QTab *tab, 1918 void LiquidStyle::drawTab(QPainter *p, const QTabBar *tabBar, QTab *tab,
1873 bool selected) 1919 bool selected)
1874 { 1920 {
1875 if(tabBar->shape() != QTabBar::RoundedAbove){ 1921 if(tabBar->shape() != QTabBar::RoundedAbove){
1876- KStyle::drawTab(p, tabBar, tab, selected); 1922- KStyle::drawTab(p, tabBar, tab, selected);
1877+ QWindowsStyle::drawTab(p, tabBar, tab, selected); 1923+ QWindowsStyle::drawTab(p, tabBar, tab, selected);
1878 return; 1924 return;
1879 } 1925 }
1880 QPixmap tilePix; 1926 QPixmap tilePix;
1881@@ -2671,7 +2388,7 @@ 1927@@ -2671,7 +2398,7 @@
1882 vFrame = 8; // was 10 1928 vFrame = 8; // was 10
1883 } 1929 }
1884 else 1930 else
1885- KStyle::tabbarMetrics(t, hFrame, vFrame, overlap); 1931- KStyle::tabbarMetrics(t, hFrame, vFrame, overlap);
1886+ QWindowsStyle::tabbarMetrics(t, hFrame, vFrame, overlap); 1932+ QWindowsStyle::tabbarMetrics(t, hFrame, vFrame, overlap);
1887 } 1933 }
1888 1934
1889 1935
1890@@ -2699,7 +2416,7 @@ 1936@@ -2699,7 +2426,7 @@
1891 p->drawLine(x+1, y+1, x+1, y2-1); 1937 p->drawLine(x+1, y+1, x+1, y2-1);
1892 } 1938 }
1893 else if(lineWidth != 2 || !sunken) 1939 else if(lineWidth != 2 || !sunken)
1894- KStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); 1940- KStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill);
1895+ QWindowsStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); 1941+ QWindowsStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill);
1896 else{ 1942 else{
1897 QPen oldPen = p->pen(); 1943 QPen oldPen = p->pen();
1898 int x2 = x+w-1; 1944 int x2 = x+w-1;
1899@@ -2726,105 +2443,6 @@ 1945@@ -2726,105 +2453,6 @@
1900 } 1946 }
1901 } 1947 }
1902 1948
1903-void LiquidStyle::drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h, 1949-void LiquidStyle::drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h,
1904- const QColorGroup &g, QBrush *) 1950- const QColorGroup &g, QBrush *)
1905-{ 1951-{
1906- p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); 1952- p->fillRect(x, y, w, h, g.brush(QColorGroup::Background));
1907- drawClearBevel(p, x, y, w, h, highlightWidget == p->device() ? 1953- drawClearBevel(p, x, y, w, h, highlightWidget == p->device() ?
1908- g.button().light(120) : g.button(), g.button()); 1954- g.button().light(120) : g.button(), g.button());
1909- /* 1955- /*
1910- if(h > w){ 1956- if(h > w){
1911- int y2 = y+h-1; 1957- int y2 = y+h-1;
1912- 1958-
1913- p->setPen(g.light()); 1959- p->setPen(g.light());
1914- 1960-
1915- p->drawLine(x+1, y+2, x+1, y2-2); 1961- p->drawLine(x+1, y+2, x+1, y2-2);
1916- p->drawLine(x+4, y+2, x+4, y2-2); 1962- p->drawLine(x+4, y+2, x+4, y2-2);
1917- 1963-
1918- p->setPen(g.dark()); 1964- p->setPen(g.dark());
1919- p->drawLine(x+2, y+2, x+2, y2-2); 1965- p->drawLine(x+2, y+2, x+2, y2-2);
1920- p->drawLine(x+5, y+2, x+5, y2-2); 1966- p->drawLine(x+5, y+2, x+5, y2-2);
1921- 1967-
1922- } 1968- }
1923- else{ 1969- else{
1924- int x2 = x+w-1; 1970- int x2 = x+w-1;
1925- 1971-
1926- p->setPen(g.light()); 1972- p->setPen(g.light());
1927- 1973-
1928- p->drawLine(x+2, y+1, x2-2, y+1); 1974- p->drawLine(x+2, y+1, x2-2, y+1);
1929- p->drawLine(x+2, y+4, x2-2, y+4); 1975- p->drawLine(x+2, y+4, x2-2, y+4);
1930- 1976-
1931- p->setPen(g.dark()); 1977- p->setPen(g.dark());
1932- p->drawLine(x+2, y+2, x2-2, y+2); 1978- p->drawLine(x+2, y+2, x2-2, y+2);
1933- p->drawLine(x+2, y+5, x2-2, y+5); 1979- p->drawLine(x+2, y+5, x2-2, y+5);
1934- }*/ 1980- }*/
1935- 1981-
1936-} 1982-}
1937- 1983-
1938-void LiquidStyle::drawKickerTaskButton(QPainter *p, int x, int y, int w, int h, 1984-void LiquidStyle::drawKickerTaskButton(QPainter *p, int x, int y, int w, int h,
1939- const QColorGroup &g, 1985- const QColorGroup &g,
1940- const QString &text, bool sunken, 1986- const QString &text, bool sunken,
1941- QPixmap *pixmap, QBrush *) 1987- QPixmap *pixmap, QBrush *)
1942-{ 1988-{
1943- p->fillRect(x, y, w, h, g.brush(QColorGroup::Button)); 1989- p->fillRect(x, y, w, h, g.brush(QColorGroup::Button));
1944- drawClearBevel(p, x, y, w, h, sunken ? g.button() : g.background(), g.button()); 1990- drawClearBevel(p, x, y, w, h, sunken ? g.button() : g.background(), g.button());
1945- p->setPen(g.buttonText()); // Kicker doesn't set this ;-) 1991- p->setPen(g.buttonText()); // Kicker doesn't set this ;-)
1946- 1992-
1947- if(text.isNull() && !pixmap) 1993- if(text.isNull() && !pixmap)
@@ -1957,97 +2003,97 @@ Features:
1957- if ( pixmap && !pixmap->isNull() ) { 2003- if ( pixmap && !pixmap->isNull() ) {
1958- int dx = ( pxWidth - pixmap->width() ) / 2; 2004- int dx = ( pxWidth - pixmap->width() ) / 2;
1959- int dy = ( h - pixmap->height() ) / 2; 2005- int dy = ( h - pixmap->height() ) / 2;
1960- p->drawPixmap( br.x()+dx, dy, *pixmap ); 2006- p->drawPixmap( br.x()+dx, dy, *pixmap );
1961- } 2007- }
1962- 2008-
1963- QString s = text; 2009- QString s = text;
1964- static const QString &modStr = KGlobal::staticQString( 2010- static const QString &modStr = KGlobal::staticQString(
1965- QString::fromUtf8("[") + i18n("modified") + QString::fromUtf8("]")); 2011- QString::fromUtf8("[") + i18n("modified") + QString::fromUtf8("]"));
1966- 2012-
1967- int modStrPos = s.find(modStr); 2013- int modStrPos = s.find(modStr);
1968- 2014-
1969- if (-1 != modStrPos) { 2015- if (-1 != modStrPos) {
1970- 2016-
1971- // +1 because we include a space after the closing brace. 2017- // +1 because we include a space after the closing brace.
1972- s.remove(modStrPos, modStr.length()+1); 2018- s.remove(modStrPos, modStr.length()+1);
1973- 2019-
1974- QPixmap modPixmap = SmallIcon("modified"); 2020- QPixmap modPixmap = SmallIcon("modified");
1975- 2021-
1976- int dx = (pxWidth - modPixmap.width()) / 2; 2022- int dx = (pxWidth - modPixmap.width()) / 2;
1977- int dy = (h - modPixmap.height()) / 2; 2023- int dy = (h - modPixmap.height()) / 2;
1978- 2024-
1979- p->drawPixmap(br.x() + textPos + dx, dy, modPixmap); 2025- p->drawPixmap(br.x() + textPos + dx, dy, modPixmap);
1980- 2026-
1981- textPos += pxWidth; 2027- textPos += pxWidth;
1982- } 2028- }
1983- 2029-
1984- if (!s.isEmpty()){ 2030- if (!s.isEmpty()){
1985- if (p->fontMetrics().width(s) > br.width() - textPos) { 2031- if (p->fontMetrics().width(s) > br.width() - textPos) {
1986- 2032-
1987- int maxLen = br.width() - textPos - p->fontMetrics().width("..."); 2033- int maxLen = br.width() - textPos - p->fontMetrics().width("...");
1988- 2034-
1989- while ((!s.isEmpty()) && (p->fontMetrics().width(s) > maxLen)) 2035- while ((!s.isEmpty()) && (p->fontMetrics().width(s) > maxLen))
1990- s.truncate(s.length() - 1); 2036- s.truncate(s.length() - 1);
1991- 2037-
1992- s.append("..."); 2038- s.append("...");
1993- } 2039- }
1994- 2040-
1995- p->setPen(g.buttonText()); 2041- p->setPen(g.buttonText());
1996- 2042-
1997- p->drawText(br.x()+ textPos, -1, w-textPos, h, 2043- p->drawText(br.x()+ textPos, -1, w-textPos, h,
1998- AlignLeft|AlignVCenter, s); 2044- AlignLeft|AlignVCenter, s);
1999- } 2045- }
2000- 2046-
2001-} 2047-}
2002 2048
2003 void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v) 2049 void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v)
2004 { 2050 {
2005@@ -2988,110 +2606,5 @@ 2051@@ -2988,110 +2616,5 @@
2006 } 2052 }
2007 } 2053 }
2008 2054
2009-// I'm debating if to use QValueList or QList here. I like QValueList better, 2055-// I'm debating if to use QValueList or QList here. I like QValueList better,
2010-// but QList handles pointers which is good for a lot of empty icons... 2056-// but QList handles pointers which is good for a lot of empty icons...
2011- 2057-
2012-void LiquidStyle::loadCustomButtons() 2058-void LiquidStyle::loadCustomButtons()
2013-{ 2059-{
2014- return; // TODO 2060- return; // TODO
2015- customBtnColorList.clear(); 2061- customBtnColorList.clear();
2016- customBtnIconList.clear(); 2062- customBtnIconList.clear();
2017- customBtnLabelList.clear(); 2063- customBtnLabelList.clear();
2018- 2064-
2019- KConfig *config = KGlobal::config(); 2065- KConfig *config = KGlobal::config();
2020- QString oldGrp = config->group(); 2066- QString oldGrp = config->group();
2021- config->setGroup("MosfetButtons"); 2067- config->setGroup("MosfetButtons");
2022- 2068-
2023- QStrList iconList, colorList; //temp, we store QPixmaps and QColors 2069- QStrList iconList, colorList; //temp, we store QPixmaps and QColors
2024- iconList.setAutoDelete(true); 2070- iconList.setAutoDelete(true);
2025- colorList.setAutoDelete(true); 2071- colorList.setAutoDelete(true);
2026- config->readListEntry("Labels", customBtnLabelList); 2072- config->readListEntry("Labels", customBtnLabelList);
2027- config->readListEntry("Icons", iconList); 2073- config->readListEntry("Icons", iconList);
2028- config->readListEntry("Colors", colorList); 2074- config->readListEntry("Colors", colorList);
2029- 2075-
2030- const char *labelStr = customBtnLabelList.first(); 2076- const char *labelStr = customBtnLabelList.first();
2031- const char *colorStr = colorList.first(); 2077- const char *colorStr = colorList.first();
2032- const char *iconStr = iconList.first(); 2078- const char *iconStr = iconList.first();
2033- 2079-
2034- KIconLoader *ldr = KGlobal::iconLoader(); 2080- KIconLoader *ldr = KGlobal::iconLoader();
2035- while(labelStr != NULL){ 2081- while(labelStr != NULL){
2036- QColor *c = new QColor; 2082- QColor *c = new QColor;
2037- c->setNamedColor(QString(colorStr)); 2083- c->setNamedColor(QString(colorStr));
2038- customBtnColorList.append(c); 2084- customBtnColorList.append(c);
2039- 2085-
2040- QString tmpStr(iconStr); 2086- QString tmpStr(iconStr);
2041- if(!tmpStr.isEmpty()){ 2087- if(!tmpStr.isEmpty()){
2042- QPixmap *pixmap = 2088- QPixmap *pixmap =
2043- new QPixmap(ldr->loadIcon(tmpStr, KIcon::Small)); 2089- new QPixmap(ldr->loadIcon(tmpStr, KIcon::Small));
2044- if(pixmap->isNull()){ 2090- if(pixmap->isNull()){
2045- delete pixmap; 2091- delete pixmap;
2046- customBtnIconList.append(NULL); 2092- customBtnIconList.append(NULL);
2047- } 2093- }
2048- else 2094- else
2049- customBtnIconList.append(pixmap); 2095- customBtnIconList.append(pixmap);
2050- } 2096- }
2051- else 2097- else
2052- customBtnIconList.append(NULL); 2098- customBtnIconList.append(NULL);
2053- 2099-
@@ -2068,144 +2114,149 @@ Features:
2068- str = str.remove(str.find('&'), 1); 2114- str = str.remove(str.find('&'), 1);
2069- 2115-
2070- const char *s; 2116- const char *s;
2071- int idx = 0; 2117- int idx = 0;
2072- for(s = customBtnLabelList.first(); s != NULL; 2118- for(s = customBtnLabelList.first(); s != NULL;
2073- ++idx, s = customBtnLabelList.next()){ 2119- ++idx, s = customBtnLabelList.next()){
2074- if(qstricmp(s, str.latin1()) == 0){ 2120- if(qstricmp(s, str.latin1()) == 0){
2075- QPalette pal = btn->palette(); 2121- QPalette pal = btn->palette();
2076- pal.setColor(QColorGroup::Button, 2122- pal.setColor(QColorGroup::Button,
2077- *customBtnColorList.at(idx)); 2123- *customBtnColorList.at(idx));
2078- btn->setPalette(pal); 2124- btn->setPalette(pal);
2079- /* 2125- /*
2080- if(customBtnIconList.at(idx) != NULL){ 2126- if(customBtnIconList.at(idx) != NULL){
2081- QPixmap *pix = customBtnIconList.at(idx); 2127- QPixmap *pix = customBtnIconList.at(idx);
2082- btn->setIconSet(QIconSet(*pix)); 2128- btn->setIconSet(QIconSet(*pix));
2083- }*/ 2129- }*/
2084- break; 2130- break;
2085- } 2131- }
2086- } 2132- }
2087-} 2133-}
2088- 2134-
2089-void LiquidStyle::unapplyCustomAttributes(QPushButton *btn) 2135-void LiquidStyle::unapplyCustomAttributes(QPushButton *btn)
2090-{ 2136-{
2091- return; // TODO 2137- return; // TODO
2092- QString str = btn->text(); 2138- QString str = btn->text();
2093- if(str.isEmpty()) 2139- if(str.isEmpty())
2094- return; 2140- return;
2095- while(str.contains('&') != 0) 2141- while(str.contains('&') != 0)
2096- str = str.remove(str.find('&'), 1); 2142- str = str.remove(str.find('&'), 1);
2097- 2143-
2098- const char *s; 2144- const char *s;
2099- for(s = customBtnLabelList.first(); s != NULL; s = customBtnLabelList.next()){ 2145- for(s = customBtnLabelList.first(); s != NULL; s = customBtnLabelList.next()){
2100- if(qstricmp(s, str.latin1()) == 0){ 2146- if(qstricmp(s, str.latin1()) == 0){
2101- btn->setPalette(QApplication::palette()); 2147- btn->setPalette(QApplication::palette());
2102- btn->setIconSet(QIconSet()); 2148- btn->setIconSet(QIconSet());
2103- break; 2149- break;
2104- } 2150- }
2105- } 2151- }
2106-} 2152-}
2107- 2153-
2108-#include "liquid.moc" 2154-#include "liquid.moc"
2109- 2155-
2110- 2156-
2111- 2157-
2112- 2158-
2113- 2159-
2114 2160
2115 /* vim: set noet sw=8 ts=8: */ 2161 /* vim: set noet sw=8 ts=8: */
2116 --- -2002-11-18 04:47:41.000000000 +0100 2162 --- -2002-11-21 20:45:47.000000000 +0100
2117 +++ plugin.cpp2002-11-18 03:54:56.000000000 +0100 2163 +++ plugin.cpp2002-11-18 18:11:41.000000000 +0100
2118@@ -1,29 +1,79 @@ 2164@@ -1,29 +1,84 @@
2119+#include <qapplication.h> 2165+#include <qapplication.h>
2120+ 2166+
2121 #include "liquid.h" 2167 #include "liquid.h"
2122-#include <klocale.h> 2168-#include <klocale.h>
2123+#include "liquidset.h" 2169+#include "liquidset.h"
2124+#include "plugin.h" 2170+#include "plugin.h"
2125+ 2171+
2126+ 2172+
2127+ 2173+
2128+LiquidInterface::LiquidInterface ( ) : ref ( 0 ) 2174+LiquidInterface::LiquidInterface ( ) : ref ( 0 )
2129+{ 2175+{
2130 +m_widget = 0; 2176 +m_widget = 0;
2131+} 2177+}
2178+
2179+LiquidInterface::~LiquidInterface ( )
2180+{
2181+}
2182+
2183+QStyle *LiquidInterface::style ( )
2184+{
2185 +return new LiquidStyle ( );
2186+}
2132 2187
2133-extern "C" { 2188-extern "C" {
2134- KStyle* allocate(); 2189- KStyle* allocate();
2135- int minor_version(); 2190- int minor_version();
2136- int major_version(); 2191- int major_version();
2137- const char *description(); 2192- const char *description();
2138+LiquidInterface::~LiquidInterface ( ) 2193+QString LiquidInterface::name ( ) const
2139+{ 2194+{
2195 +return qApp-> translate ( "Styles", "Liquid" );
2140 } 2196 }
2141 2197
2142-KStyle* allocate() 2198-KStyle* allocate()
2143+QStyle *LiquidInterface::style ( ) 2199+QString LiquidInterface::description ( ) const
2144 { 2200 {
2145- return(new LiquidStyle); 2201- return(new LiquidStyle);
2146 +return new LiquidStyle ( ); 2202 +return qApp-> translate ( "Styles", "High Performance Liquid style by Mosfet" );
2147 } 2203 }
2148 2204
2149-int minor_version() 2205-int minor_version()
2150+QString LiquidInterface::name ( ) const 2206+bool LiquidInterface::hasSettings ( ) const
2151 { 2207 {
2152- return(0); 2208- return(0);
2153 +return qApp-> translate ( "Styles", "Liquid" ); 2209 +return true;
2154 } 2210 }
2155 2211
2156-int major_version() 2212-int major_version()
2157+QString LiquidInterface::description ( ) const 2213+QWidget *LiquidInterface::create ( QWidget *parent, const char *name )
2158 { 2214 {
2159- return(1); 2215- return(1);
2160 +return qApp-> translate ( "Styles", "High Performance Liquid style by Mosfet" ); 2216 +m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" );
2217 +
2218 +return m_widget;
2161 } 2219 }
2162 2220
2163-const char *description() 2221-const char *description()
2164+bool LiquidInterface::hasSettings ( ) const 2222+bool LiquidInterface::accept ( )
2165 { 2223 {
2166- return(i18n("High performance liquid plugin").utf8()); 2224- return(i18n("High performance liquid plugin").utf8());
2167 +return true;
2168+}
2169+
2170+QWidget *LiquidInterface::create ( QWidget *parent, const char *name )
2171+{
2172 +m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" );
2173 +
2174 +return m_widget;
2175+}
2176+
2177+bool LiquidInterface::accept ( )
2178+{
2179 +if ( !m_widget ) 2225 +if ( !m_widget )
2180 + return false; 2226 + return false;
2181+ 2227+
2182 +return m_widget-> writeConfig ( ); 2228 +return m_widget-> writeConfig ( );
2183 } 2229 }
2184+ 2230+
2185+void LiquidInterface::reject ( ) 2231+void LiquidInterface::reject ( )
2186+{ 2232+{
2187+} 2233+}
2188+ 2234+
2189+ 2235+
2190+QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) 2236+QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
2191+{ 2237+{
2192 +*iface = 0; 2238 +*iface = 0;
2193 + 2239 +
2194 +if ( uuid == IID_QUnknown ) 2240 +if ( uuid == IID_QUnknown )
2195 + *iface = this; 2241 + *iface = this;
2196 +else if ( uuid == IID_Style ) 2242 +else if ( uuid == IID_Style )
2197 + *iface = this; 2243 + *iface = this;
2198 +else if ( uuid == IID_StyleExtended ) 2244 +else if ( uuid == IID_StyleExtended )
2199 + *iface = this; 2245 + *iface = this;
2200 + 2246 +
2201 +if ( *iface ) 2247 +if ( *iface )
2202 + (*iface)-> addRef ( ); 2248 + (*iface)-> addRef ( );
2203 + 2249 +
2204 +return QS_OK; 2250 +return QS_OK;
2205+} 2251+}
2206+ 2252+
2207+Q_EXPORT_INTERFACE() 2253+Q_EXPORT_INTERFACE()
2208+{ 2254+{
2209 +Q_CREATE_INSTANCE( LiquidInterface ) 2255 +Q_CREATE_INSTANCE( LiquidInterface )
2210+} 2256+}
2211+ 2257+
2258+
2259+// For Sharp ROM
2260+
2261+extern "C" { QStyle *allocate ( ) { return new LiquidStyle ( ); } }
2262+extern "C" { void drawmenubaritem ( QStyle *sty, QPainter *p, int x, int y, int w, int h, QMenuItem *mi, QColorGroup &g, bool enabled, bool active ) { return ((LiquidStyle *) sty )-> drawMenuBarItem ( p, x, y, w, h, mi, g, enabled, active ); } }