summaryrefslogtreecommitdiff
path: root/noncore/styles/liquid/opie-liquid.diff
Unidiff
Diffstat (limited to 'noncore/styles/liquid/opie-liquid.diff') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/liquid/opie-liquid.diff1117
1 files changed, 910 insertions, 207 deletions
diff --git a/noncore/styles/liquid/opie-liquid.diff b/noncore/styles/liquid/opie-liquid.diff
index f3531e5..29ae6f3 100644
--- a/noncore/styles/liquid/opie-liquid.diff
+++ b/noncore/styles/liquid/opie-liquid.diff
@@ -3,8 +3,8 @@ 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 --- -2002-10-24 03:19:30.000000000 +0200 6 --- -2002-11-18 04:47:41.000000000 +0100
7 +++ liquid.h2002-07-15 02:52:50.000000000 +0200 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
@@ -102,17 +102,58 @@ Features:
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@@ -198,25 +171,15 @@
106 void drawSBButton(QPainter *p, const QRect &r, const QColorGroup &g,
107 bool down=false, bool fast = true);
108 void drawRoundRect(QPainter *p, int x, int y, int w, int h);
109- void loadCustomButtons();
110- void applyCustomAttributes(QPushButton *btn);
111- void unapplyCustomAttributes(QPushButton *btn);
106 QPixmap* getPixmap(BitmapData item); 112 QPixmap* getPixmap(BitmapData item);
107 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);
108 private: 114 private:
115- bool highcolor;
116- QColorGroup radioOnGrp;
117 +bool oldqte;
109 +bool flatTBButtons; 118 +bool flatTBButtons;
110 bool highcolor;
111 QColorGroup radioOnGrp;
112 QWidget *highlightWidget; 119 QWidget *highlightWidget;
113 --- -2002-10-24 03:19:31.000000000 +0200 120- QBrush wallpaper;
114 +++ liquid.cpp2002-10-24 03:18:15.000000000 +0200 121- QBitmap lightBmp;
115@@ -10,12 +10,10 @@ 122- QBitmap grayBmp;
123- QBitmap dgrayBmp;
124- QBitmap maskBmp;
125- QBitmap xBmp;
126 QBitmap btnMaskBmp, htmlBtnMaskBmp;
127 QPixmap *btnBorderPix, *btnBlendPix, *bevelFillPix, *smallBevelFillPix, *menuPix;
128- QBitmap paper1, paper2, paper3;
129- QBrush baseBrush, menuBrush, pagerBrush, pagerHoverBrush, bgBrush;
130+ QBrush bgBrush, menuBrush;
131 bool menuAni, menuFade;
132
133 QIntDict<QPixmap>btnDict;
134@@ -224,9 +187,6 @@
135 QIntDict<QPixmap>bevelFillDict;
136 QIntDict<QPixmap>smallBevelFillDict;
137
138- QList<QColor>customBtnColorList;
139- QList<QPixmap>customBtnIconList;
140- QStrList customBtnLabelList;
141 QPixmap *vsbSliderFillPix;
142 TransMenuHandler *menuHandler;
143 QPixmap *pixmaps[BITMAP_ITEMS];
144 --- -2002-11-18 04:47:41.000000000 +0100
145 +++ liquid.cpp2002-11-18 04:46:13.000000000 +0100
146@@ -2,6 +2,9 @@
147 * Copyright (C)QPL 2001 Daniel M. Duley. All rights reserved.
148 */
149
150+//
151+// (c) 2002 Robert 'sandman' Griebl
152+//
153
154
155 #ifndef INCLUDE_MENUITEM_DEF
156@@ -10,12 +13,10 @@
116 157
117 #include <qmenudata.h> 158 #include <qmenudata.h>
118 #include "liquid.h" 159 #include "liquid.h"
@@ -129,7 +170,7 @@ Features:
129 #include <qpalette.h> 170 #include <qpalette.h>
130 #include <qbitmap.h> 171 #include <qbitmap.h>
131 #include <qtabbar.h> 172 #include <qtabbar.h>
132@@ -25,28 +23,29 @@ 173@@ -25,28 +26,30 @@
133 #include <qtimer.h> 174 #include <qtimer.h>
134 #include <qpixmapcache.h> 175 #include <qpixmapcache.h>
135 #include <qradiobutton.h> 176 #include <qradiobutton.h>
@@ -147,6 +188,7 @@ Features:
147-#include <kipc.h> 188-#include <kipc.h>
148+#include <qmenubar.h> 189+#include <qmenubar.h>
149+#include <qprogressbar.h> 190+#include <qprogressbar.h>
191+#include <qlineedit.h>
150 192
151-#include <X11/X.h> 193-#include <X11/X.h>
152-#include <X11/Xlib.h> 194-#include <X11/Xlib.h>
@@ -169,7 +211,7 @@ Features:
169 int x, y; 211 int x, y;
170 int r, g, b; 212 int r, g, b;
171 for(y=0; y < img.height(); y+=3){ 213 for(y=0; y < img.height(); y+=3){
172@@ -71,35 +70,37 @@ 214@@ -71,35 +74,37 @@
173 : QObject(parent) 215 : QObject(parent)
174 { 216 {
175 pixDict.setAutoDelete(true); 217 pixDict.setAutoDelete(true);
@@ -220,7 +262,7 @@ Features:
220 if(p->testWFlags(Qt::WType_Popup)){ 262 if(p->testWFlags(Qt::WType_Popup)){
221 QRect r(p->x(), p->y(), p->width(), p->height()); 263 QRect r(p->x(), p->y(), p->width(), p->height());
222 QRect deskR = QApplication::desktop()->rect(); 264 QRect deskR = QApplication::desktop()->rect();
223@@ -107,7 +108,7 @@ 265@@ -107,7 +112,7 @@
224 r.setBottom(deskR.bottom()); 266 r.setBottom(deskR.bottom());
225 r.setRight(deskR.right()); 267 r.setRight(deskR.right());
226 } 268 }
@@ -229,7 +271,7 @@ Features:
229 r.width(), r.height()); 271 r.width(), r.height());
230 } 272 }
231 else{ // tear off menu 273 else{ // tear off menu
232@@ -121,82 +122,53 @@ 274@@ -121,82 +126,61 @@
233 stripePixmap(*pix, p->colorGroup().button()); 275 stripePixmap(*pix, p->colorGroup().button());
234 } 276 }
235 else{ 277 else{
@@ -266,11 +308,11 @@ Features:
266-{ 308-{
267- if(id == LIQUID_MENU_CHANGE){ 309- if(id == LIQUID_MENU_CHANGE){
268- bool oldShadow = shadowText; 310- bool oldShadow = shadowText;
269+// qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width()); 311-
270
271- KConfig *config = KGlobal::config(); 312- KConfig *config = KGlobal::config();
272- config->reparseConfiguration(); // in case KControl changed values 313- config->reparseConfiguration(); // in case KControl changed values
273- 314+// qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width());
315
274- // 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
275- // the user just clicked "Apply", but there can be tear offs ;-) 317- // the user just clicked "Apply", but there can be tear offs ;-)
276- // We just close them so the pixmaps are deleted and regenerated. 318- // We just close them so the pixmaps are deleted and regenerated.
@@ -299,10 +341,9 @@ Features:
299- ++it; 341- ++it;
300- if(w->inherits("QMenuBar")){ 342- if(w->inherits("QMenuBar")){
301- w->repaint(); 343- w->repaint();
344- }
345- }
302 + wid-> setBackgroundMode( QWidget::PaletteBackground ); 346 + wid-> setBackgroundMode( QWidget::PaletteBackground );
303 }
304 + delete ol;
305 }
306 } 347 }
307- } 348- }
308- else if(id == MOSFET_BUTTON_CHANGE){ 349- else if(id == MOSFET_BUTTON_CHANGE){
@@ -323,11 +364,18 @@ Features:
323- ++it; 364- ++it;
324- if(w->inherits("QPushButton")){ 365- if(w->inherits("QPushButton")){
325- ((LiquidStyle*)parent())->applyCustomAttributes((QPushButton *)w); 366- ((LiquidStyle*)parent())->applyCustomAttributes((QPushButton *)w);
326- } 367 + delete ol;
327- } 368 }
328- 369 }
329- }
330+ return(false); 370+ return(false);
371+}
372
373- }
374+
375+static int qt_version ( )
376+{
377 +const char *qver = qVersion ( );
378 +return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' );
331 } 379 }
332 380
333+ 381+
@@ -337,12 +385,221 @@ Features:
337 { 385 {
338+ setName ( "LiquidStyle" ); 386+ setName ( "LiquidStyle" );
339+ 387+
388 +oldqte = ( qt_version ( ) < 234 );
340 +flatTBButtons = false; 389 +flatTBButtons = false;
341+ 390+
342 btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); 391 btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true);
343 btnMaskBmp.setMask(btnMaskBmp); 392 btnMaskBmp.setMask(btnMaskBmp);
344 htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); 393 htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true);
345@@ -711,7 +683,6 @@ 394@@ -207,12 +191,8 @@
395 btnDict.setAutoDelete(true);
396 bevelFillDict.setAutoDelete(true);
397 smallBevelFillDict.setAutoDelete(true);
398- customBtnColorList.setAutoDelete(true);
399- customBtnIconList.setAutoDelete(true);
400- customBtnLabelList.setAutoDelete(true);
401
402 rMatrix.rotate(270.0);
403- highcolor = QPixmap::defaultDepth() > 8;
404 btnBorderPix = new QPixmap;
405 btnBorderPix->convertFromImage(qembed_findImage("buttonfill"));
406 btnBlendPix = new QPixmap;
407@@ -572,131 +552,119 @@
408 case HTMLBtnBorderDown:
409 pixmaps[HTMLBtnBorderDown] = processEmbedded("htmlbtnborder", btnHoverH, btnHoverS, btnHoverV);
410 break;
411+
412 case HTMLCB:
413 pixmaps[HTMLCB] = processEmbedded("htmlcheckbox", bH, bS, bV);
414 break;
415+ case HTMLCBHover:
416+ pixmaps[HTMLCBHover] = processEmbedded("htmlcheckbox", btnHoverH, btnHoverS, btnHoverV);
417+ break;
418 case HTMLCBDown:
419 pixmaps[HTMLCBDown] = processEmbedded("htmlcheckboxdown", btnH, btnS, btnV);
420 break;
421- case HTMLCBHover:
422- pixmaps[HTMLCBHover] = processEmbedded("htmlcheckbox", btnH, btnS, btnV);
423- break;
424 case HTMLCBDownHover:
425- pixmaps[HTMLCBDownHover] = processEmbedded("htmlcheckboxdown",
426- btnHoverH, btnHoverS,
427- btnHoverV);
428+ pixmaps[HTMLCBDownHover] = processEmbedded("htmlcheckboxdown", btnHoverH, btnHoverS, btnHoverV);
429 break;
430+
431 case HTMLRadio:
432 pixmaps[HTMLRadio] = processEmbedded("htmlradio", bH, bS, bV);
433 + break;
434+ case HTMLRadioHover:
435+ pixmaps[HTMLRadioHover] = processEmbedded("htmlradio", btnHoverH, btnHoverS, btnHoverV);
436 + break;
437 case HTMLRadioDown:
438 pixmaps[HTMLRadioDown] = processEmbedded("htmlradiodown", btnH, btnS, btnV);
439- case HTMLRadioHover:
440- pixmaps[HTMLRadioHover] = processEmbedded("htmlradio", btnH, btnS, btnV);
441 + break;
442 case HTMLRadioDownHover:
443- pixmaps[HTMLRadioDownHover] = processEmbedded("htmlradiodown",
444- btnHoverH, btnHoverS,
445- btnHoverV);
446+ pixmaps[HTMLRadioDownHover] = processEmbedded("htmlradiodown", btnHoverH, btnHoverS, btnHoverV);
447 + break;
448+
449+ case RadioOff:
450+ pixmaps[RadioOff] = processEmbedded("radio", bH, bS, bV /*, true*/);
451+ break;
452+ case RadioOffHover:
453+ pixmaps[RadioOffHover] = processEmbedded("radio", btnHoverH, btnHoverS, btnHoverV /*, true*/);
454+ break;
455 case RadioOn:
456- pixmaps[RadioOn] = processEmbedded("radio_down", btnH, btnS, btnV, true);
457+ pixmaps[RadioOn] = processEmbedded("radio_down", btnH, btnS, btnV /*, true*/);
458 break;
459 case RadioOnHover:
460- pixmaps[RadioOnHover] = processEmbedded("radio_down", btnHoverH, btnHoverS,
461- btnHoverV, true);
462+ pixmaps[RadioOnHover] = processEmbedded("radio_down", btnHoverH, btnHoverS, btnHoverV /*, true*/);
463 break;
464- case RadioOffHover:
465- pixmaps[RadioOffHover] = processEmbedded("radio", btnH, btnS, btnV, true);
466+
467+ case Tab:
468+ pixmaps[Tab] = processEmbedded("tab", bH, bS, bV /*, true*/);
469 break;
470 case TabDown:
471- pixmaps[TabDown] = processEmbedded("tab", btnH, btnS, btnV, true);
472+ pixmaps[TabDown] = processEmbedded("tab", btnH, btnS, btnV /*, true*/);
473 break;
474 case TabFocus:
475- pixmaps[TabFocus] = processEmbedded("tab", btnHoverH, btnHoverS,
476- btnHoverS, true);
477- break;
478- case CBDown:
479- pixmaps[CBDown] = processEmbedded("checkboxdown", btnH, btnS, btnV, true);
480+ pixmaps[TabFocus] = processEmbedded("tab", btnHoverH, btnHoverS, btnHoverV /*, true*/);
481 break;
482- case CBDownHover:
483- pixmaps[CBDownHover] = processEmbedded("checkboxdown", btnHoverH,
484- btnHoverS, btnHoverV, true);
485+
486 +case CB:
487+ pixmaps[CB] = processEmbedded("checkbox", bH, bS, bV /*, true*/);
488 break;
489 case CBHover:
490- pixmaps[CBHover] = processEmbedded("checkbox", btnH, btnS, btnV, true);
491+ pixmaps[CBHover] = processEmbedded("checkbox", btnHoverH, btnHoverS, btnHoverV /*, true*/);
492 break;
493- case HSlider:
494- pixmaps[HSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true);
495+ case CBDown:
496+ pixmaps[CBDown] = processEmbedded("checkboxdown", btnH, btnS, btnV /*, true*/);
497 break;
498+ case CBDownHover:
499+ pixmaps[CBDownHover] = processEmbedded("checkboxdown", btnHoverH, btnHoverS, btnHoverV /*, true*/);
500+ break;
501+
502 case VSlider:
503- pixmaps[VSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true);
504+ pixmaps[VSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true );
505 *pixmaps[VSlider] = pixmaps[VSlider]->xForm(rMatrix);
506 break;
507- case RadioOff:
508- pixmaps[RadioOff] = processEmbedded("radio", bH, bS, bV, true);
509- break;
510- case Tab:
511- pixmaps[Tab] = processEmbedded("tab", bH, bS, bV, true);
512- break;
513- case CB:
514- pixmaps[CB] = processEmbedded("checkbox", bH, bS, bV, true);
515- break;
516 case VSBSliderTop:
517- pixmaps[VSBSliderTop] = processEmbedded("sbslider_top", btnH, btnS, btnV, true);
518+ case VSBSliderTopHover:
519+ pixmaps[item] = processEmbedded("sbslider_top", btnH, btnS, btnV /*, true*/);
520 break;
521 case VSBSliderBtm:
522- pixmaps[VSBSliderBtm] = processEmbedded("sbslider_btm", btnH, btnS, btnV, true);
523+ case VSBSliderBtmHover:
524+ pixmaps[item] = processEmbedded("sbslider_btm", btnH, btnS, btnV /*, true*/);
525 break;
526 case VSBSliderMid:
527- pixmaps[VSBSliderMid] = processEmbedded("sbslider_mid", btnH, btnS, btnV);
528+ case VSBSliderMidHover:
529+ pixmaps[item] = processEmbedded("sbslider_mid", btnH, btnS, btnV);
530 break;
531- case VSBSliderTopHover:
532- pixmaps[VSBSliderTopHover] = processEmbedded("sbslider_top", btnHoverH, btnHoverS, btnHoverV, true);
533 +case VSBSliderTopBg:
534+ pixmaps[VSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV /*, true*/);
535 break;
536- case VSBSliderBtmHover:
537- pixmaps[VSBSliderBtmHover] = processEmbedded("sbslider_btm", btnHoverH, btnHoverS, btnHoverV, true);
538+ case VSBSliderBtmBg:
539+ pixmaps[VSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV /*, true*/);
540 break;
541- case VSBSliderMidHover:
542- pixmaps[VSBSliderMidHover] = processEmbedded("sbslider_mid", btnHoverH, btnHoverS, btnHoverV);
543+ case VSBSliderMidBg:
544+ pixmaps[VSBSliderMidBg] = processEmbedded("sbslider_mid", bH, bS, bV);
545 break;
546
547- case HSBSliderTop:
548- pixmaps[HSBSliderTop] = processEmbedded("sbslider_top", btnH, btnS, btnV, true);
549- *pixmaps[HSBSliderTop] = pixmaps[HSBSliderTop]->xForm(rMatrix);
550- break;
551- case HSBSliderBtm:
552- pixmaps[HSBSliderBtm] = processEmbedded("sbslider_btm", btnH, btnS, btnV, true);
553- *pixmaps[HSBSliderBtm] = pixmaps[HSBSliderBtm]->xForm(rMatrix);
554- break;
555- case HSBSliderMid:
556- pixmaps[HSBSliderMid] = processEmbedded("sbslider_mid", btnH, btnS, btnV);
557- *pixmaps[HSBSliderMid] = pixmaps[HSBSliderMid]->xForm(rMatrix);
558 +case HSlider:
559+ pixmaps[HSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV /*, true*/);
560 break;
561+ case HSBSliderTop:
562 case HSBSliderTopHover:
563- pixmaps[HSBSliderTopHover] = processEmbedded("sbslider_top", btnHoverH, btnHoverS, btnHoverV, true);
564- *pixmaps[HSBSliderTopHover] = pixmaps[HSBSliderTopHover]->xForm(rMatrix);
565+ pixmaps[item] = processEmbedded("sbslider_top", btnH, btnS, btnV, true );
566+ *pixmaps[item] = pixmaps[item]->xForm(rMatrix);
567 break;
568+ case HSBSliderBtm:
569 case HSBSliderBtmHover:
570- pixmaps[HSBSliderBtmHover] = processEmbedded("sbslider_btm", btnHoverH, btnHoverS, btnHoverV, true);
571- *pixmaps[HSBSliderBtmHover] = pixmaps[HSBSliderBtmHover]->xForm(rMatrix);
572+ pixmaps[item] = processEmbedded("sbslider_btm", btnH, btnS, btnV, true );
573+ *pixmaps[item] = pixmaps[item]->xForm(rMatrix);
574 break;
575+ case HSBSliderMid:
576 case HSBSliderMidHover:
577- pixmaps[HSBSliderMidHover] = processEmbedded("sbslider_mid", btnHoverH, btnHoverS, btnHoverV);
578- *pixmaps[HSBSliderMidHover] = pixmaps[HSBSliderMidHover]->xForm(rMatrix);
579- break;
580- case VSBSliderTopBg:
581- pixmaps[VSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV, true);
582- break;
583- case VSBSliderBtmBg:
584- pixmaps[VSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV, true);
585- break;
586- case VSBSliderMidBg:
587- pixmaps[VSBSliderMidBg] = processEmbedded("sbslider_mid", bH, bS, bV);
588+ pixmaps[item] = processEmbedded("sbslider_mid", btnH, btnS, btnV);
589+ *pixmaps[item] = pixmaps[item]->xForm(rMatrix);
590 break;
591 case HSBSliderTopBg:
592- pixmaps[HSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV, true);
593+ pixmaps[HSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV, true );
594 *pixmaps[HSBSliderTopBg] = pixmaps[HSBSliderTopBg]->xForm(rMatrix);
595 break;
596 case HSBSliderBtmBg:
597- pixmaps[HSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV, true);
598+ pixmaps[HSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV, true );
599 *pixmaps[HSBSliderBtmBg] = pixmaps[HSBSliderBtmBg]->xForm(rMatrix);
600 break;
601 case HSBSliderMidBg:
602@@ -711,7 +679,6 @@
346 603
347 void LiquidStyle::polish(QPalette &appPal) 604 void LiquidStyle::polish(QPalette &appPal)
348 { 605 {
@@ -350,10 +607,21 @@ Features:
350 int i; 607 int i;
351 for(i=0; i < BITMAP_ITEMS; ++i){ 608 for(i=0; i < BITMAP_ITEMS; ++i){
352 if(pixmaps[i]){ 609 if(pixmaps[i]){
353@@ -730,20 +701,29 @@ 610@@ -719,31 +686,28 @@
611 pixmaps[i] = NULL;
612 }
354 } 613 }
355 614- QWidgetList *list = QApplication::allWidgets();
356 loadCustomButtons(); 615- QWidgetListIt it( *list );
616- QWidget *w;
617- while ((w=it.current()) != 0 ){
618- ++it;
619- if(w->inherits("QPushButton")){
620- unapplyCustomAttributes((QPushButton *)w);
621- }
622- }
623-
624- loadCustomButtons();
357- lowLightVal = 100 + (2*KGlobalSettings::contrast()+4)*10; 625- lowLightVal = 100 + (2*KGlobalSettings::contrast()+4)*10;
358+ lowLightVal = 100 + (2* /*KGlobalSettings::contrast()*/ 3 +4)*10; 626+ lowLightVal = 100 + (2* /*KGlobalSettings::contrast()*/ 3 +4)*10;
359 btnDict.clear(); 627 btnDict.clear();
@@ -379,16 +647,32 @@ Features:
379- QColor c = config->readColorEntry("buttonBackground", &Qt::lightGray); 647- QColor c = config->readColorEntry("buttonBackground", &Qt::lightGray);
380- if(c == config->readColorEntry("background", &Qt::lightGray)){ 648- if(c == config->readColorEntry("background", &Qt::lightGray)){
381+ config. setGroup ( "Appearance" ); 649+ config. setGroup ( "Appearance" );
382+ QColor c = // QColor ( config. readEntry("Button", ( Qt::lightGray ). name ( ))); 650+ QColor c = oldqte ? QColor ( config. readEntry("Button", ( Qt::lightGray ). name ( )))
383+ appPal. color ( QPalette::Active, QColorGroup::Button ); 651+ : appPal. color ( QPalette::Active, QColorGroup::Button );
384+ if ( c == appPal. color ( QPalette::Active, QColorGroup::Background ) 652+ if ( c == ( oldqte ? QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( )))
385+ //QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( ))) 653+ : appPal. color ( QPalette::Active, QColorGroup::Background ))) {
386+ ) {
387 // force button color to be different from background 654 // force button color to be different from background
388 QBrush btnBrush(QColor(200, 202, 228)); 655 QBrush btnBrush(QColor(200, 202, 228));
389 appPal.setBrush(QColorGroup::Button, btnBrush); 656 appPal.setBrush(QColorGroup::Button, btnBrush);
390@@ -794,15 +774,7 @@ 657@@ -778,8 +742,8 @@
391 pagerBrush.setPixmap(*pix); 658 adjustHSV(*pix, h, s, v);
659 smallBevelFillDict.insert(c.rgb(), pix);
660 }
661- pagerHoverBrush.setColor(c);
662- pagerHoverBrush.setPixmap(*pix);
663+// pagerHoverBrush.setColor(c);
664+// pagerHoverBrush.setPixmap(*pix);
665
666 c = c.dark(120);
667 pix = smallBevelFillDict.find(c.rgb()); // better be NULL ;-)
668@@ -790,19 +754,13 @@
669 adjustHSV(*pix, h, s, v);
670 smallBevelFillDict.insert(c.rgb(), pix);
671 }
672- pagerBrush.setColor(c);
673- pagerBrush.setPixmap(*pix);
674+// pagerBrush.setColor(c);
675+// pagerBrush.setPixmap(*pix);
392 676
393 // background color stuff 677 // background color stuff
394- c = config->readColorEntry("background", &Qt::lightGray); 678- c = config->readColorEntry("background", &Qt::lightGray);
@@ -400,11 +684,13 @@ Features:
400- menuBrush.setColor(c); // hack - used for kicker applets 684- menuBrush.setColor(c); // hack - used for kicker applets
401- appPal.setBrush(QColorGroup::Background, menuBrush); 685- appPal.setBrush(QColorGroup::Background, menuBrush);
402- } 686- }
403+ c = /*QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( )));*/ appPal. color ( QPalette::Active, QColorGroup::Background ); 687+ c = oldqte ? QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( )))
688+ : appPal. color ( QPalette::Active, QColorGroup::Background );
689+
404 c.hsv(&bH, &bS, &bV); 690 c.hsv(&bH, &bS, &bV);
405 c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV); 691 c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV);
406 692
407@@ -817,21 +789,18 @@ 693@@ -817,101 +775,50 @@
408 wallPaper.fill(c.rgb()); 694 wallPaper.fill(c.rgb());
409 painter.begin(&wallPaper); 695 painter.begin(&wallPaper);
410 for(i=0; i < 32; i+=4){ 696 for(i=0; i < 32; i+=4){
@@ -422,17 +708,33 @@ Features:
422- qstrcmp(kapp->argv()[0], "ksplash") != 0){ 708- qstrcmp(kapp->argv()[0], "ksplash") != 0){
423 appPal.setBrush(QColorGroup::Background, bgBrush); 709 appPal.setBrush(QColorGroup::Background, bgBrush);
424- } 710- }
425 711-
426 // lineedits 712- // lineedits
427- c = config->readColorEntry("windowBackground", &Qt::white); 713- c = config->readColorEntry("windowBackground", &Qt::white);
428+ c = /*QColor ( config. readEntry("Base", ( Qt::white). name ( )));*/ appPal. color ( QPalette::Active, QColorGroup::Base ); 714- QPixmap basePix;
429 QPixmap basePix; 715- basePix.resize(32, 32);
430 basePix.resize(32, 32); 716- basePix.fill(c.rgb());
431 basePix.fill(c.rgb()); 717- painter.begin(&basePix);
432@@ -856,52 +825,37 @@ 718- painter.setPen(c.dark(105));
433 applyCustomAttributes((QPushButton *)w); 719- for(i=0; i < 32; i+=4){
434 } 720- painter.drawLine(0, i, 32, i);
435 } 721- painter.drawLine(0, i+1, 32, i+1);
722- };
723- painter.end();
724- baseBrush.setColor(c);
725- baseBrush.setPixmap(basePix);
726- it.toFirst();
727- while ((w=it.current()) != 0 ){
728- ++it;
729- if(w->inherits("QLineEdit")){
730- QPalette pal = w->palette();
731- pal.setBrush(QColorGroup::Base, baseBrush);
732- w->setPalette(pal);
733- }
734- else if(w->inherits("QPushButton")){
735- applyCustomAttributes((QPushButton *)w);
736- }
737- }
436- 738-
437- config->setGroup(oldGrp); 739- config->setGroup(oldGrp);
438 } 740 }
@@ -489,34 +791,39 @@ Features:
489- } 791- }
490 792
491- if(w->inherits("QComboBox") || 793- if(w->inherits("QComboBox") ||
492+ if(w->inherits("QComboBox") || w->inherits("QProgressBar") || 794- w->inherits("QLineEdit") || w->inherits("QRadioButton") ||
493 w->inherits("QLineEdit") || w->inherits("QRadioButton") ||
494- w->inherits("QCheckBox") || w->inherits("QScrollBar") || 795- w->inherits("QCheckBox") || w->inherits("QScrollBar") ||
495- w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || 796- w->isA("AppletHandle") || w->inherits("KMiniPagerButton") ||
496- w->inherits("TaskContainer")){ 797- w->inherits("TaskContainer")){
497+ w->inherits("QCheckBox") || w->inherits("QScrollBar")) { 798+ if(w->inherits("QRadioButton") || w->inherits("QCheckBox") || w->inherits("QProgressBar")) {
498 w->installEventFilter(this);
499 }
500 if(w->inherits("QLineEdit")){
501@@ -913,6 +867,10 @@
502 applyCustomAttributes((QPushButton *)w);
503 w->installEventFilter(this); 799 w->installEventFilter(this);
504 } 800 }
801- if(w->inherits("QLineEdit")){
802- QPalette pal = w->palette();
803- pal.setBrush(QColorGroup::Base, baseBrush);
804- w->setPalette(pal);
805- }
806- if(w->inherits("QPushButton")){
807- applyCustomAttributes((QPushButton *)w);
808- w->installEventFilter(this);
809+
505+ if(w->inherits("QButton") || w-> inherits("QComboBox")){ 810+ if(w->inherits("QButton") || w-> inherits("QComboBox")){
506 + w-> setBackgroundMode ( QWidget::PaletteBackground ); 811 + w-> setBackgroundMode ( QWidget::PaletteBackground );
507 + w->setBackgroundOrigin ( QWidget::ParentOrigin); 812 + w->setBackgroundOrigin ( QWidget::ParentOrigin);
508+ } 813 }
509 814
510 bool isViewport = qstrcmp(w->name(), "qt_viewport") == 0 || 815 bool isViewport = qstrcmp(w->name(), "qt_viewport") == 0 ||
511 qstrcmp(w->name(), "qt_clipped_viewport") == 0; 816@@ -942,11 +849,20 @@
512@@ -942,11 +900,17 @@
513 w->setMouseTracking(true); 817 w->setMouseTracking(true);
514 w->installEventFilter(this); 818 w->installEventFilter(this);
515 } 819 }
516+ if(w-> inherits("QToolButton")&&w->parent()->inherits("QToolBar")) { 820+ if(w-> inherits("QToolButton")) {
517 + ((QToolButton*)w)->setAutoRaise (flatTBButtons); 821+ if (w->parent()->inherits("QToolBar")) {
518 + if ( flatTBButtons ) 822 + ((QToolButton*)w)->setAutoRaise (flatTBButtons);
519 + w->setBackgroundOrigin(QWidget::ParentOrigin); 823 + if ( flatTBButtons )
824 + w->setBackgroundOrigin(QWidget::ParentOrigin);
825 + }
826 + w-> installEventFilter ( this );
520+ } 827+ }
521+ if(w-> inherits("QToolBarSeparator")&&w->parent()->inherits("QToolBar")) { 828+ if(w-> inherits("QToolBarSeparator")&&w->parent()->inherits("QToolBar")) {
522 + ((QFrame *) w)-> setFrameShape ( QFrame::NoFrame ); 829 + ((QFrame *) w)-> setFrameShape ( QFrame::NoFrame );
@@ -529,7 +836,7 @@ Features:
529 836
530 if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())-> 837 if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())->
531 palette().active().brush(QColorGroup::Background).pixmap()){ 838 palette().active().brush(QColorGroup::Background).pixmap()){
532@@ -954,16 +918,21 @@ 839@@ -954,16 +870,21 @@
533 return; 840 return;
534 } 841 }
535 if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) && 842 if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) &&
@@ -557,7 +864,7 @@ Features:
557 } 864 }
558 } 865 }
559 866
560@@ -977,6 +946,11 @@ 867@@ -977,6 +898,11 @@
561 868
562 if(w->inherits("QPopupMenu")) 869 if(w->inherits("QPopupMenu"))
563 w->setBackgroundMode(QWidget::PaletteButton); 870 w->setBackgroundMode(QWidget::PaletteButton);
@@ -569,7 +876,7 @@ Features:
569 876
570 if(w->isTopLevel()) 877 if(w->isTopLevel())
571 return; 878 return;
572@@ -986,7 +960,7 @@ 879@@ -986,7 +912,7 @@
573 ((qstrcmp(w->parent()->name(), "qt_viewport") == 0) || 880 ((qstrcmp(w->parent()->name(), "qt_viewport") == 0) ||
574 (qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0)); 881 (qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0));
575 882
@@ -578,30 +885,36 @@ Features:
578 if(w->backgroundMode() == QWidget::X11ParentRelative || isViewportChild){ 885 if(w->backgroundMode() == QWidget::X11ParentRelative || isViewportChild){
579 if(w->inherits("QPushButton")) 886 if(w->inherits("QPushButton"))
580 w->setBackgroundMode(QWidget::PaletteButton); 887 w->setBackgroundMode(QWidget::PaletteButton);
581@@ -1001,12 +975,14 @@ 888@@ -997,16 +923,12 @@
582 unapplyCustomAttributes((QPushButton *)w); 889 if(isViewportChild)
583 w->removeEventFilter(this); 890 w->setAutoMask(false);
584 } 891
585- 892- if(w->inherits("QPushButton")){
893- unapplyCustomAttributes((QPushButton *)w);
894- w->removeEventFilter(this);
586+/* 895+/*
587+ if(w->inherits("QPushButton") || w-> inherits("QComboBox")){ 896+ if(w->inherits("QPushButton") || w-> inherits("QComboBox")){
588 + w-> setBackgroundMode ( PaletteBackground ); 897 + w-> setBackgroundMode ( PaletteBackground );
589+ } 898 }
590+*/ 899-
591 if(w->inherits("QComboBox") || 900- if(w->inherits("QComboBox") ||
592 w->inherits("QLineEdit") || w->inherits("QRadioButton") || 901- w->inherits("QLineEdit") || w->inherits("QRadioButton") ||
593- w->inherits("QCheckBox") || w->inherits("QScrollBar") || 902- w->inherits("QCheckBox") || w->inherits("QScrollBar") ||
594- w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || 903- w->isA("AppletHandle") || w->inherits("KMiniPagerButton") ||
595- w->inherits("TaskContainer")){ 904- w->inherits("TaskContainer")){
596+ w->inherits("QCheckBox") || w->inherits("QScrollBar")) { 905+*/
906+ if( w->inherits("QRadioButton") || w->inherits("QCheckBox") || w->inherits("QProgressBar")) {
597 w->removeEventFilter(this); 907 w->removeEventFilter(this);
598 } 908 }
599 if(w->inherits("QButton") || w->inherits("QComboBox")){ 909 if(w->inherits("QButton") || w->inherits("QComboBox")){
600@@ -1014,9 +990,9 @@ 910@@ -1014,9 +936,12 @@
601 w->setAutoMask(false); 911 w->setAutoMask(false);
602 } 912 }
603 } 913 }
604- if(w->inherits("KToolBar")){ 914- if(w->inherits("KToolBar")){
915+ if(w-> inherits("QToolButton")) {
916 + w-> removeEventFilter ( this );
917+ }
605+ if(w->inherits("QToolBar")){ 918+ if(w->inherits("QToolBar")){
606 w->removeEventFilter(this); 919 w->removeEventFilter(this);
607- //w->setBackgroundMode(QWidget::PaletteBackground); 920- //w->setBackgroundMode(QWidget::PaletteBackground);
@@ -609,7 +922,7 @@ Features:
609 return; 922 return;
610 } 923 }
611 if(w->inherits("QHeader")){ 924 if(w->inherits("QHeader")){
612@@ -1028,22 +1004,98 @@ 925@@ -1028,22 +953,118 @@
613 void LiquidStyle::polish(QApplication *app) 926 void LiquidStyle::polish(QApplication *app)
614 { 927 {
615 928
@@ -706,11 +1019,31 @@ Features:
706+}; 1019+};
707+ 1020+
708+ 1021+
1022+/*
1023+ * The same for QToolButton:
1024+ * TT hardcoded the drawing of the focus rect ...
1025+ *
1026+ * - sandman
1027+ */
1028+
1029+
1030+class HackToolButton : public QToolButton {
1031+public:
1032 +HackToolButton ( );
1033 +
1034 +void paint ( QPaintEvent *ev )
1035 +{
1036 + erase ( ev-> region ( ));
1037 + QPainter p ( this );
1038 + style ( ). drawToolButton ( this, &p );
1039 + drawButtonLabel ( &p );
1040 +}
1041+};
709+ 1042+
710 /* 1043 /*
711 * This is a fun method ;-) Here's an overview. KToolBar grabs resize to 1044 * This is a fun method ;-) Here's an overview. KToolBar grabs resize to
712 * force everything to erase and repaint on resize. This is going away, I'm 1045 * force everything to erase and repaint on resize. This is going away, I'm
713@@ -1063,7 +1115,7 @@ 1046@@ -1063,7 +1084,7 @@
714 */ 1047 */
715 bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) 1048 bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev)
716 { 1049 {
@@ -719,7 +1052,7 @@ Features:
719 if(ev->type() == QEvent::Resize){ 1052 if(ev->type() == QEvent::Resize){
720 const QObjectList *tbChildList = obj->children(); 1053 const QObjectList *tbChildList = obj->children();
721 QObjectListIt it(*tbChildList); 1054 QObjectListIt it(*tbChildList);
722@@ -1076,35 +1128,7 @@ 1055@@ -1076,116 +1097,27 @@
723 1056
724 } 1057 }
725 } 1058 }
@@ -752,14 +1085,20 @@ Features:
752- } 1085- }
753- else if(obj->inherits("QPushButton") || obj->inherits("QComboBox") || 1086- else if(obj->inherits("QPushButton") || obj->inherits("QComboBox") ||
754- obj->isA("AppletHandle")){ 1087- obj->isA("AppletHandle")){
755+ else if(obj->inherits("QPushButton") || obj->inherits("QComboBox")){ 1088- QWidget *btn = (QWidget *)obj;
756 QWidget *btn = (QWidget *)obj; 1089- if(ev->type() == QEvent::Enter){
757 if(ev->type() == QEvent::Enter){ 1090- if(btn->isEnabled()){
758 if(btn->isEnabled()){ 1091- highlightWidget = btn;
759@@ -1119,20 +1143,7 @@ 1092- btn->repaint(false);
760 } 1093- }
761 } 1094- }
762 } 1095- else if(ev->type() == QEvent::Leave){
1096- if(btn == highlightWidget){
1097- highlightWidget = NULL;
1098- btn->repaint(false);
1099- }
1100- }
1101- }
763- else if(obj->inherits("TaskContainer")){ 1102- else if(obj->inherits("TaskContainer")){
764- QButton *btn = (QButton *)obj; 1103- QButton *btn = (QButton *)obj;
765- QPalette pal = btn->palette(); 1104- QPalette pal = btn->palette();
@@ -774,11 +1113,127 @@ Features:
774- } 1113- }
775- } 1114- }
776- else if(obj->inherits("QToolButton") && !obj->inherits("KToolBarButton")){ 1115- else if(obj->inherits("QToolButton") && !obj->inherits("KToolBarButton")){
1116- QToolButton *btn = (QToolButton *)btn;
1117- if(!btn->autoRaise()){
777+ else if(obj->inherits("QToolButton")){ 1118+ else if(obj->inherits("QToolButton")){
778 QToolButton *btn = (QToolButton *)btn; 1119+ QToolButton *btn = (QToolButton *)obj;
779 if(!btn->autoRaise()){ 1120+ if(ev->type() == QEvent::FocusIn ){ // && !btn-> autoRaise ()
780 if(btn->isEnabled()){ 1121 if(btn->isEnabled()){
781@@ -1290,7 +1301,24 @@ 1122 highlightWidget = btn;
1123 btn->repaint(false);
1124+
1125 + qDebug ( "TB FOCUS IN [%p]", btn );
1126 }
1127 }
1128- else if(ev->type() == QEvent::Leave){
1129- QWidget *btn = (QWidget *)obj;
1130+ else if(ev->type() == QEvent::FocusOut ){
1131 if(btn == highlightWidget){
1132 highlightWidget = NULL;
1133 btn->repaint(false);
1134+
1135+ qDebug ( "TB FOCUS OUT [%p]", btn );
1136 }
1137 }
1138- else
1139- highlightWidget = NULL;
1140- }
1141- else if(obj->inherits("QScrollBar")){
1142- QScrollBar *sb = (QScrollBar *)obj;
1143- if(ev->type() == QEvent::Enter){
1144- if(sb->isEnabled()){
1145- highlightWidget = sb;
1146- sb->repaint(false);
1147- }
1148- }
1149- else if(ev->type() == QEvent::Leave){
1150- if(sb == highlightWidget && !sb->draggingSlider()){
1151- highlightWidget = NULL;
1152- sb->repaint(false);
1153- }
1154- }
1155- else if(ev->type() == QEvent::MouseButtonRelease){
1156- QMouseEvent *me = (QMouseEvent *)ev;
1157- if(sb == highlightWidget && !sb->rect().contains(me->pos())){
1158- highlightWidget = NULL;
1159- sb->repaint(false);
1160- }
1161- }
1162- }
1163- else if(obj->inherits("QLineEdit")){
1164- if(obj->parent() && obj->parent()->inherits("QComboBox")){
1165- QWidget *btn = (QComboBox *)obj->parent();
1166- if(ev->type() == QEvent::Enter){
1167- if (btn->isEnabled()){
1168- highlightWidget = btn;
1169- btn->repaint(false);
1170- }
1171- }
1172- else if(ev->type() == QEvent::Leave){
1173- if (btn == highlightWidget)
1174- highlightWidget = NULL;
1175- btn->repaint(false);
1176- }
1177+ else if(ev->type() == QEvent::Paint) {
1178 + (( HackToolButton *) btn )-> paint ((QPaintEvent *) ev );
1179 + return true;
1180 }
1181 }
1182 else if(obj->inherits("QRadioButton") || obj->inherits("QCheckBox")){
1183@@ -1201,6 +1133,7 @@
1184 QSize sz = isRadio ? exclusiveIndicatorSize()
1185 : indicatorSize();
1186
1187+/*
1188 if(btn->hasFocus()){
1189 QRect r = QRect(0, 0, btn->width(), btn->height());
1190 p.setPen(btn->colorGroup().button().dark(140));
1191@@ -1209,6 +1142,7 @@
1192 p.drawLine(r.right(), r.y()+1, r.right(), r.bottom()-1);
1193 p.drawLine(r.x()+1, r.bottom(), r.right()-1, r.bottom());
1194 }
1195+*/
1196 int x = 0;
1197 int y = (btn->height()-lsz.height()+fm.height()-sz.height())/2;
1198 if(isRadio)
1199@@ -1228,36 +1162,6 @@
1200 p.end();
1201 return(true);
1202 }
1203- // for hover, just redraw the indicator (not the text)
1204- else if((ev->type() == QEvent::Enter && btn->isEnabled()) ||
1205- (ev->type() == QEvent::Leave && btn == highlightWidget)){
1206- QButton *btn = (QButton *)obj;
1207- bool isRadio = obj->inherits("QRadioButton");
1208-
1209- if(ev->type() == QEvent::Enter)
1210- highlightWidget = btn;
1211- else
1212- highlightWidget = NULL;
1213- QFontMetrics fm = btn->fontMetrics();
1214- QSize lsz = fm.size(ShowPrefix, btn->text());
1215- QSize sz = isRadio ? exclusiveIndicatorSize()
1216- : indicatorSize();
1217- int x = 0;
1218- int y = (btn->height()-lsz.height()+fm.height()-sz.height())/2;
1219- //if(btn->autoMask())
1220- // btn->erase(x+1, y+1, sz.width()-2, sz.height()-2);
1221- QPainter p;
1222- p.begin(btn);
1223- if(isRadio)
1224- drawExclusiveIndicator(&p, x, y, sz.width(), sz.height(),
1225- btn->colorGroup(), btn->isOn(),
1226- btn->isDown(), btn->isEnabled());
1227- else
1228- drawIndicator(&p, x, y, sz.width(), sz.height(),
1229- btn->colorGroup(), btn->state(), btn->isDown(),
1230- btn->isEnabled());
1231- p.end();
1232- }
1233 }
1234 else if(obj->inherits("QHeader")){
1235 QHeader *hw = (QHeader *)obj;
1236@@ -1290,7 +1194,24 @@
782 } 1237 }
783 } 1238 }
784 } 1239 }
@@ -804,7 +1259,19 @@ Features:
804 } 1259 }
805 1260
806 void LiquidStyle::drawButton(QPainter *p, int x, int y, int w, int h, 1261 void LiquidStyle::drawButton(QPainter *p, int x, int y, int w, int h,
807@@ -1340,11 +1368,6 @@ 1262@@ -1325,8 +1246,11 @@
1263 }
1264
1265 p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix);
1266+ qDebug ( "DRAW TOOLBUTTON IN PIXMAP" );
1267 }
1268 else{
1269 + qDebug ( "DRAW TOOLBUTTON sunken=%d/high=%p/device=%p", sunken, highlightWidget,p->device() );
1270+
1271 drawClearBevel(p, x, y, w, h, sunken ? g.button() :
1272 highlightWidget == p->device() ? g.button().light(110) :
1273 g.background(), g.background());
1274@@ -1340,11 +1264,6 @@
808 QColorGroup g = btn->colorGroup(); 1275 QColorGroup g = btn->colorGroup();
809 1276
810 1277
@@ -816,7 +1283,59 @@ Features:
816 //int dw = buttonDefaultIndicatorWidth(); 1283 //int dw = buttonDefaultIndicatorWidth();
817 if(btn->hasFocus() || btn->isDefault()){ 1284 if(btn->hasFocus() || btn->isDefault()){
818 QColor c = btn->hasFocus() ? g.button().light(110) : g.background(); 1285 QColor c = btn->hasFocus() ? g.button().light(110) : g.background();
819@@ -1596,7 +1619,7 @@ 1286@@ -1488,7 +1407,20 @@
1287 const QColorGroup &g, bool sunken,
1288 bool edit, bool, const QBrush *)
1289 {
1290- bool isHover = highlightWidget == painter->device();
1291+ bool isActive = false;
1292+ if (( painter->device()->devType() == QInternal::Widget ) &&
1293+ (
1294+ ( qApp-> focusWidget ( ) == painter-> device ( )) ||
1295+ (
1296+ edit &&
1297+ ((QWidget *) painter-> device ( ))-> inherits ( "QComboBox" ) &&
1298+ ( qApp-> focusWidget ( ) == ((QComboBox *) painter->device())->lineEdit ( ))
1299+ )
1300+ )
1301+ ) {
1302 + isActive = true;
1303+ }
1304 +
1305 bool isMasked = false;
1306 if(painter->device()->devType() == QInternal::Widget)
1307 isMasked = ((QWidget*)painter->device())->autoMask();
1308@@ -1498,7 +1430,7 @@
1309
1310 drawRoundButton(&p, g.button(), g.background(), 0, 0, w, h, false,
1311 sunken, false, isMasked);
1312- if(!isHover){
1313+ if(!isActive){
1314 p.setClipRect(0, 0, w-17, h);
1315 drawRoundButton(&p, g.background(), g.background(), 0, 0, w, h, false,
1316 sunken, false, isMasked);
1317@@ -1550,16 +1482,17 @@
1318 return(QRect(x+9, y+3, w - (h / 3) - 20, h-6));
1319 }
1320
1321-QRect LiquidStyle::comboButtonFocusRect(int x, int y, int w, int h)
1322+QRect LiquidStyle::comboButtonFocusRect(int /*x*/, int /*y*/, int /*w*/, int /*h*/)
1323 {
1324- return(QRect(x+5, y+3, w-(h/3)-13, h-5));
1325 +return QRect ( );
1326 +
1327+// return(QRect(x+5, y+3, w-(h/3)-13, h-5));
1328 }
1329
1330 void LiquidStyle::drawScrollBarControls(QPainter *p, const QScrollBar *sb,
1331 int sliderStart, uint controls,
1332 uint activeControl)
1333 {
1334- bool isHover = highlightWidget == p->device();
1335 int sliderMin, sliderMax, sliderLength, buttonDim;
1336 scrollBarMetrics( sb, sliderMin, sliderMax, sliderLength, buttonDim );
1337
1338@@ -1596,7 +1529,7 @@
820 if(sbBuffer.size() != sb->size()) 1339 if(sbBuffer.size() != sb->size())
821 sbBuffer.resize(sb->size()); 1340 sbBuffer.resize(sb->size());
822 } 1341 }
@@ -825,7 +1344,7 @@ Features:
825 addB.setRect( addX,addY,buttonDim,buttonDim ); 1344 addB.setRect( addX,addY,buttonDim,buttonDim );
826 if(horiz) 1345 if(horiz)
827 subHC.setRect(addX-buttonDim,addY,buttonDim,buttonDim ); 1346 subHC.setRect(addX-buttonDim,addY,buttonDim,buttonDim );
828@@ -1624,7 +1647,7 @@ 1347@@ -1624,7 +1557,7 @@
829 QPainter painter; 1348 QPainter painter;
830 if(!horiz){ 1349 if(!horiz){
831 painter.begin(&sbBuffer); 1350 painter.begin(&sbBuffer);
@@ -834,7 +1353,46 @@ Features:
834 if(sliderR.height() >= 8){ 1353 if(sliderR.height() >= 8){
835 painter.drawPixmap(bgR.x()+1, bgR.y(), *vsbSliderFillPix, 0, 0, 1354 painter.drawPixmap(bgR.x()+1, bgR.y(), *vsbSliderFillPix, 0, 0,
836 13, 8); 1355 13, 8);
837@@ -1690,7 +1713,7 @@ 1356@@ -1648,25 +1581,15 @@
1357 }
1358 if(controls & Slider){
1359 if(sliderR.height() >= 16){
1360- painter.drawPixmap(sliderR.x()+1, sliderR.y(),
1361- isHover ? *getPixmap(VSBSliderTopHover):
1362- *getPixmap(VSBSliderTop));
1363+ painter.drawPixmap(sliderR.x()+1, sliderR.y(), *getPixmap(VSBSliderTop));
1364 painter.drawTiledPixmap(sliderR.x()+1, sliderR.y()+8, 13,
1365- sliderR.height()-16, isHover ?
1366- *getPixmap(VSBSliderMidHover) :
1367- *getPixmap(VSBSliderMid));
1368- painter.drawPixmap(sliderR.x()+1, sliderR.bottom()-8,
1369- isHover ? *getPixmap(VSBSliderBtmHover) :
1370- *getPixmap(VSBSliderBtm));
1371+ sliderR.height()-16, *getPixmap(VSBSliderMid));
1372+ painter.drawPixmap(sliderR.x()+1, sliderR.bottom()-8, *getPixmap(VSBSliderBtm));
1373 }
1374 else if(sliderR.height() >= 8){
1375 int m = sliderR.height()/2;
1376- painter.drawPixmap(sliderR.x()+1, sliderR.y(),
1377- isHover ? *getPixmap(VSBSliderTopHover):
1378- *getPixmap(VSBSliderTop), 0, 0, 13, m);
1379- painter.drawPixmap(sliderR.x()+1, sliderR.y()+m,
1380- isHover ? *getPixmap(VSBSliderBtmHover):
1381- *getPixmap(VSBSliderBtm), 0, 8-m, 13, m);
1382+ painter.drawPixmap(sliderR.x()+1, sliderR.y(), *getPixmap(VSBSliderTop), 0, 0, 13, m);
1383+ painter.drawPixmap(sliderR.x()+1, sliderR.y()+m, *getPixmap(VSBSliderBtm), 0, 8-m, 13, m);
1384 }
1385 else{
1386 painter.setPen(g.button().dark(210));
1387@@ -1674,7 +1597,6 @@
1388 13, sliderR.height());
1389 painter.drawTiledPixmap(sliderR.x()+2, sliderR.y()+1,
1390 11, sliderR.height()-2,
1391- isHover ? *getPixmap(VSBSliderMidHover) :
1392 *getPixmap(VSBSliderMid), 1, 0);
1393 }
1394 }
1395@@ -1690,7 +1612,7 @@
838 } 1396 }
839 else{ 1397 else{
840 painter.begin(&sbBuffer); 1398 painter.begin(&sbBuffer);
@@ -843,7 +1401,43 @@ Features:
843 if(sliderR.width() >= 8){ 1401 if(sliderR.width() >= 8){
844 painter.drawPixmap(bgR.x(), bgR.y()+1, *vsbSliderFillPix, 0, 0, 1402 painter.drawPixmap(bgR.x(), bgR.y()+1, *vsbSliderFillPix, 0, 0,
845 8, 13); 1403 8, 13);
846@@ -1761,10 +1784,10 @@ 1404@@ -1715,22 +1637,17 @@
1405 if(controls & Slider){
1406 if(sliderR.width() >= 16){
1407 painter.drawPixmap(sliderR.x(), sliderR.y()+1,
1408- isHover ? *getPixmap(HSBSliderTopHover) :
1409 *getPixmap(HSBSliderTop));
1410 painter.drawTiledPixmap(sliderR.x()+8, sliderR.y()+1, sliderR.width()-16,
1411- 13, isHover ? *getPixmap(HSBSliderMidHover) :
1412- *getPixmap(HSBSliderMid));
1413- painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, isHover ?
1414- *getPixmap(HSBSliderBtmHover) :
1415+ 13, *getPixmap(HSBSliderMid));
1416+ painter.drawPixmap(sliderR.right()-8, sliderR.y()+1,
1417 *getPixmap(HSBSliderBtm));
1418 }
1419 else if(sliderR.width() >= 8){
1420 int m = sliderR.width()/2;
1421 painter.drawPixmap(sliderR.x(), sliderR.y()+1,
1422- isHover ? *getPixmap(HSBSliderTopHover) :
1423 *getPixmap(HSBSliderTop), 0, 0, m, 13);
1424- painter.drawPixmap(sliderR.right()-8, sliderR.y()+1, isHover ?
1425- *getPixmap(HSBSliderBtmHover) :
1426+ painter.drawPixmap(sliderR.right()-8, sliderR.y()+1,
1427 *getPixmap(HSBSliderBtm), 8-m, 0, m, 13);
1428 }
1429 else{
1430@@ -1738,8 +1655,7 @@
1431 drawRoundRect(&painter, sliderR.x(), sliderR.y()+1,
1432 sliderR.width(), 13);
1433 painter.drawTiledPixmap(sliderR.x()+1, sliderR.y()+2,
1434- sliderR.width()-2, 11, isHover ?
1435- *getPixmap(HSBSliderMidHover) :
1436+ sliderR.width()-2, 11,
1437 *getPixmap(HSBSliderMid), 0, 1);
1438 }
1439 }
1440@@ -1761,10 +1677,10 @@
847 addB.width()-8, addB.height()-8, g, !maxed); 1441 addB.width()-8, addB.height()-8, g, !maxed);
848 } 1442 }
849 if ( controls & SubLine ) { 1443 if ( controls & SubLine ) {
@@ -858,7 +1452,7 @@ Features:
858 drawSBButton(p, subHC, g, activeControl == SubLine); 1452 drawSBButton(p, subHC, g, activeControl == SubLine);
859 drawArrow( p, horiz ? LeftArrow : UpArrow, 1453 drawArrow( p, horiz ? LeftArrow : UpArrow,
860 false, subHC.x()+4, subHC.y()+4, 1454 false, subHC.x()+4, subHC.y()+4,
861@@ -1865,8 +1888,8 @@ 1455@@ -1865,8 +1781,8 @@
862 else 1456 else
863 buttonDim = ( length - b*2 )/2 - 1; 1457 buttonDim = ( length - b*2 )/2 - 1;
864 1458
@@ -869,7 +1463,7 @@ Features:
869 1463
870 if ( sb->maxValue() == sb->minValue() ) { 1464 if ( sb->maxValue() == sb->minValue() ) {
871 sliderLength = maxLength; 1465 sliderLength = maxLength;
872@@ -1914,8 +1937,8 @@ 1466@@ -1914,31 +1830,31 @@
873 return(QSize(16, 16)); 1467 return(QSize(16, 16));
874 } 1468 }
875 1469
@@ -879,8 +1473,36 @@ Features:
879+ int /*h*/, const QColorGroup &/*g*/, bool on, 1473+ int /*h*/, const QColorGroup &/*g*/, bool on,
880 bool down, bool) 1474 bool down, bool)
881 { 1475 {
882 bool isHover = highlightWidget == p->device(); 1476- bool isHover = highlightWidget == p->device();
883@@ -1957,8 +1980,8 @@ 1477+ bool isActive = ( p->device()->devType() == QInternal::Widget ) && ( qApp-> focusWidget ( ) == p-> device ( ));
1478 bool isMasked = p->device() && p->device()->devType() == QInternal::Widget
1479 && ((QWidget*)p->device())->autoMask();
1480
1481 if(isMasked){
1482 if(on || down){
1483- p->drawPixmap(x, y, isHover ? *getPixmap(HTMLRadioDownHover) :
1484+ p->drawPixmap(x, y, isActive ? *getPixmap(HTMLRadioDownHover) :
1485 *getPixmap(HTMLRadioDown));
1486 }
1487 else
1488- p->drawPixmap(x, y, isHover ? *getPixmap(HTMLRadioHover) :
1489+ p->drawPixmap(x, y, isActive ? *getPixmap(HTMLRadioHover) :
1490 *getPixmap(HTMLRadio));
1491
1492 }
1493 else{
1494 if(on || down){
1495- p->drawPixmap(x, y, isHover ? *getPixmap(RadioOnHover) :
1496+ p->drawPixmap(x, y, isActive ? *getPixmap(RadioOnHover) :
1497 *getPixmap(RadioOn));
1498 }
1499 else
1500- p->drawPixmap(x, y, isHover ? *getPixmap(RadioOffHover) :
1501+ p->drawPixmap(x, y, isActive ? *getPixmap(RadioOffHover) :
1502 *getPixmap(RadioOff));
1503 }
1504 }
1505@@ -1957,25 +1873,25 @@
884 return(QSize(20, 22)); 1506 return(QSize(20, 22));
885 } 1507 }
886 1508
@@ -889,9 +1511,35 @@ Features:
889+void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int /*w*/, int /*h*/, 1511+void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int /*w*/, int /*h*/,
890+ const QColorGroup &/*g*/, int state, bool /*down*/, bool) 1512+ const QColorGroup &/*g*/, int state, bool /*down*/, bool)
891 { 1513 {
892 bool isHover = highlightWidget == p->device(); 1514- bool isHover = highlightWidget == p->device();
1515+ bool isActive = ( p->device()->devType() == QInternal::Widget ) && ( qApp-> focusWidget ( ) == p-> device ( ));
893 bool isMasked = p->device() && p->device()->devType() == QInternal::Widget 1516 bool isMasked = p->device() && p->device()->devType() == QInternal::Widget
894@@ -1996,8 +2019,8 @@ 1517 && ((QWidget*)p->device())->autoMask();
1518 if(isMasked){
1519 if(state != QButton::Off){
1520- p->drawPixmap(x, y, isHover ? *getPixmap(HTMLCBDownHover) :
1521+ p->drawPixmap(x, y, isActive ? *getPixmap(HTMLCBDownHover) :
1522 *getPixmap(HTMLCBDown));
1523 }
1524 else
1525- p->drawPixmap(x, y, isHover ? *getPixmap(HTMLCBHover) :
1526+ p->drawPixmap(x, y, isActive ? *getPixmap(HTMLCBHover) :
1527 *getPixmap(HTMLCB));
1528
1529 }
1530 else{
1531 if(state != QButton::Off){
1532- p->drawPixmap(x, y, isHover ? *getPixmap(CBDownHover) :
1533+ p->drawPixmap(x, y, isActive ? *getPixmap(CBDownHover) :
1534 *getPixmap(CBDown));
1535 /* Todo - tristate
1536 if(state == QButton::On){
1537@@ -1992,12 +1908,12 @@
1538 }*/
1539 }
1540 else
1541- p->drawPixmap(x, y, isHover ? *getPixmap(CBHover) : *getPixmap(CB));
1542+ p->drawPixmap(x, y, isActive ? *getPixmap(CBHover) : *getPixmap(CB));
895 } 1543 }
896 } 1544 }
897 1545
@@ -902,7 +1550,7 @@ Features:
902 { 1550 {
903 // 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
904 p->drawPixmap(x, y, *getPixmap(HTMLCB)->mask()); 1552 p->drawPixmap(x, y, *getPixmap(HTMLCB)->mask());
905@@ -2005,18 +2028,17 @@ 1553@@ -2005,18 +1921,17 @@
906 } 1554 }
907 1555
908 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,
@@ -924,7 +1572,7 @@ Features:
924 Orientation orient, bool, bool) 1572 Orientation orient, bool, bool)
925 { 1573 {
926 p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() : 1574 p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() :
927@@ -2065,203 +2087,26 @@ 1575@@ -2065,203 +1980,26 @@
928 p->drawLineSegments(a); 1576 p->drawLineSegments(a);
929 } 1577 }
930 1578
@@ -946,7 +1594,7 @@ Features:
946- p->drawPoint(x, y2); 1594- p->drawPoint(x, y2);
947- p->drawPoint(x2, y2); 1595- p->drawPoint(x2, y2);
948- 1596-
949 1597-
950- 1598-
951- // p->drawRect(x, y, w, h); 1599- // p->drawRect(x, y, w, h);
952- QPixmap *pix = bevelFillDict.find(g.button().rgb()); 1600- QPixmap *pix = bevelFillDict.find(g.button().rgb());
@@ -963,9 +1611,7 @@ Features:
963- 1611-
964-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,
965- const QColorGroup &g, bool mac, QBrush *) 1613- const QColorGroup &g, bool mac, QBrush *)
966+void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, 1614-{
967+ QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active )
968 {
969- if(p->device() && p->device()->devType() == QInternal::Widget && 1615- if(p->device() && p->device()->devType() == QInternal::Widget &&
970- ((KMenuBar *)p->device())->isTopLevelMenu()){ 1616- ((KMenuBar *)p->device())->isTopLevelMenu()){
971- p->setPen(Qt::black); 1617- p->setPen(Qt::black);
@@ -989,10 +1635,12 @@ Features:
989- } 1635- }
990- 1636-
991-} 1637-}
992- 1638
993-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,
994- const QColorGroup &g, KToolBarPos, QBrush *) 1640- const QColorGroup &g, KToolBarPos, QBrush *)
995-{ 1641+void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h,
1642+ QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active )
1643 {
996- //p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); 1644- //p->fillRect(x, y, w, h, g.brush(QColorGroup::Background));
997-} 1645-}
998- 1646-
@@ -1118,8 +1766,8 @@ Features:
1118+ h += 2; 1766+ h += 2;
1119 } 1767 }
1120-} 1768-}
1121
1122- 1769-
1770
1123-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,
1124- const QColorGroup &g, bool active, QMenuItem *mi, 1772- const QColorGroup &g, bool active, QMenuItem *mi,
1125- QBrush *) 1773- QBrush *)
@@ -1140,7 +1788,7 @@ Features:
1140 g.background().dark(130); 1788 g.background().dark(130);
1141 } 1789 }
1142 else 1790 else
1143@@ -2300,8 +2145,8 @@ 1791@@ -2300,8 +2038,8 @@
1144 } 1792 }
1145 1793
1146 void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h, 1794 void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h,
@@ -1151,7 +1799,7 @@ Features:
1151 { 1799 {
1152 QColor c; 1800 QColor c;
1153 switch(menuHandler->transType()){ 1801 switch(menuHandler->transType()){
1154@@ -2336,8 +2181,6 @@ 1802@@ -2336,8 +2074,6 @@
1155 1803
1156 maxpmw = QMAX( maxpmw, 20 ); 1804 maxpmw = QMAX( maxpmw, 20 );
1157 1805
@@ -1160,7 +1808,7 @@ Features:
1160 1808
1161 bool dis = !enabled; 1809 bool dis = !enabled;
1162 QColorGroup itemg = dis ? pal.disabled() : pal.active(); 1810 QColorGroup itemg = dis ? pal.disabled() : pal.active();
1163@@ -2363,7 +2206,7 @@ 1811@@ -2363,7 +2099,7 @@
1164 p->fillRect(x, y, w, h, menuBrush); 1812 p->fillRect(x, y, w, h, menuBrush);
1165 } 1813 }
1166 else{ 1814 else{
@@ -1169,7 +1817,7 @@ Features:
1169 if(pix) 1817 if(pix)
1170 p->drawPixmap(x, y, *pix, x, y, w, h); 1818 p->drawPixmap(x, y, *pix, x, y, w, h);
1171 } 1819 }
1172@@ -2508,25 +2351,6 @@ 1820@@ -2508,25 +2244,6 @@
1173 return h; 1821 return h;
1174 } 1822 }
1175 1823
@@ -1195,7 +1843,12 @@ Features:
1195 1843
1196 void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r, 1844 void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r,
1197 const QColorGroup &g, const QColor *c, 1845 const QColorGroup &g, const QColor *c,
1198@@ -2540,25 +2364,25 @@ 1846@@ -2536,29 +2253,29 @@
1847 if(p->device()->devType() == QInternal::Widget){
1848 // if so does it use a special focus rectangle?
1849 QWidget *w = (QWidget *)p->device();
1850- if(w->inherits("QPushButton") || w->inherits("QSlider")){
1851+ if(w->inherits("QPushButton") || w->inherits("QSlider") || w->inherits("QComboBox") || w->inherits("QToolButton" )){
1199 return; 1852 return;
1200 } 1853 }
1201 else{ 1854 else{
@@ -1225,7 +1878,7 @@ Features:
1225 return; 1878 return;
1226 } 1879 }
1227 QPixmap tilePix; 1880 QPixmap tilePix;
1228@@ -2671,7 +2495,7 @@ 1881@@ -2671,7 +2388,7 @@
1229 vFrame = 8; // was 10 1882 vFrame = 8; // was 10
1230 } 1883 }
1231 else 1884 else
@@ -1234,7 +1887,7 @@ Features:
1234 } 1887 }
1235 1888
1236 1889
1237@@ -2699,7 +2523,7 @@ 1890@@ -2699,7 +2416,7 @@
1238 p->drawLine(x+1, y+1, x+1, y2-1); 1891 p->drawLine(x+1, y+1, x+1, y2-1);
1239 } 1892 }
1240 else if(lineWidth != 2 || !sunken) 1893 else if(lineWidth != 2 || !sunken)
@@ -1243,7 +1896,7 @@ Features:
1243 else{ 1896 else{
1244 QPen oldPen = p->pen(); 1897 QPen oldPen = p->pen();
1245 int x2 = x+w-1; 1898 int x2 = x+w-1;
1246@@ -2726,105 +2550,6 @@ 1899@@ -2726,105 +2443,6 @@
1247 } 1900 }
1248 } 1901 }
1249 1902
@@ -1349,65 +2002,120 @@ Features:
1349 2002
1350 void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v) 2003 void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v)
1351 { 2004 {
1352@@ -2998,22 +2723,22 @@ 2005@@ -2988,110 +2606,5 @@
1353 customBtnIconList.clear(); 2006 }
1354 customBtnLabelList.clear(); 2007 }
1355 2008
2009-// 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...
2011-
2012-void LiquidStyle::loadCustomButtons()
2013-{
2014- return; // TODO
2015- customBtnColorList.clear();
2016- customBtnIconList.clear();
2017- customBtnLabelList.clear();
2018-
1356- KConfig *config = KGlobal::config(); 2019- KConfig *config = KGlobal::config();
1357- QString oldGrp = config->group(); 2020- QString oldGrp = config->group();
1358- config->setGroup("MosfetButtons"); 2021- config->setGroup("MosfetButtons");
1359+// KConfig *config = KGlobal::config(); 2022-
1360+// QString oldGrp = config->group(); 2023- QStrList iconList, colorList; //temp, we store QPixmaps and QColors
1361+// config->setGroup("MosfetButtons"); 2024- iconList.setAutoDelete(true);
1362 2025- colorList.setAutoDelete(true);
1363 QStrList iconList, colorList; //temp, we store QPixmaps and QColors
1364 iconList.setAutoDelete(true);
1365 colorList.setAutoDelete(true);
1366- config->readListEntry("Labels", customBtnLabelList); 2026- config->readListEntry("Labels", customBtnLabelList);
1367- config->readListEntry("Icons", iconList); 2027- config->readListEntry("Icons", iconList);
1368- config->readListEntry("Colors", colorList); 2028- config->readListEntry("Colors", colorList);
1369+// config->readListEntry("Labels", customBtnLabelList); 2029-
1370+// config->readListEntry("Icons", iconList); 2030- const char *labelStr = customBtnLabelList.first();
1371+// config->readListEntry("Colors", colorList); 2031- const char *colorStr = colorList.first();
1372 2032- const char *iconStr = iconList.first();
1373 const char *labelStr = customBtnLabelList.first(); 2033-
1374 const char *colorStr = colorList.first();
1375 const char *iconStr = iconList.first();
1376
1377- KIconLoader *ldr = KGlobal::iconLoader(); 2034- KIconLoader *ldr = KGlobal::iconLoader();
1378+// KIconLoader *ldr = KGlobal::iconLoader(); 2035- while(labelStr != NULL){
1379 while(labelStr != NULL){ 2036- QColor *c = new QColor;
1380 QColor *c = new QColor; 2037- c->setNamedColor(QString(colorStr));
1381 c->setNamedColor(QString(colorStr)); 2038- customBtnColorList.append(c);
1382@@ -3022,7 +2747,7 @@ 2039-
1383 QString tmpStr(iconStr); 2040- QString tmpStr(iconStr);
1384 if(!tmpStr.isEmpty()){ 2041- if(!tmpStr.isEmpty()){
1385 QPixmap *pixmap = 2042- QPixmap *pixmap =
1386- new QPixmap(ldr->loadIcon(tmpStr, KIcon::Small)); 2043- new QPixmap(ldr->loadIcon(tmpStr, KIcon::Small));
1387+ new QPixmap();//ldr->loadIcon(tmpStr, KIcon::Small)); 2044- if(pixmap->isNull()){
1388 if(pixmap->isNull()){ 2045- delete pixmap;
1389 delete pixmap; 2046- customBtnIconList.append(NULL);
1390 customBtnIconList.append(NULL); 2047- }
1391@@ -3037,7 +2762,6 @@ 2048- else
1392 colorStr = colorList.next(); 2049- customBtnIconList.append(pixmap);
1393 iconStr = iconList.next(); 2050- }
1394 } 2051- else
2052- customBtnIconList.append(NULL);
2053-
2054- labelStr = customBtnLabelList.next();
2055- colorStr = colorList.next();
2056- iconStr = iconList.next();
2057- }
1395- config->setGroup(oldGrp); 2058- config->setGroup(oldGrp);
1396 } 2059-}
1397 2060-
1398 void LiquidStyle::applyCustomAttributes(QPushButton *btn) 2061-void LiquidStyle::applyCustomAttributes(QPushButton *btn)
1399@@ -3087,7 +2811,7 @@ 2062-{
1400 } 2063- return; // TODO
1401 } 2064- QString str = btn->text();
1402 2065- if(str.isEmpty())
2066- return;
2067- while(str.contains('&') != 0)
2068- str = str.remove(str.find('&'), 1);
2069-
2070- const char *s;
2071- int idx = 0;
2072- for(s = customBtnLabelList.first(); s != NULL;
2073- ++idx, s = customBtnLabelList.next()){
2074- if(qstricmp(s, str.latin1()) == 0){
2075- QPalette pal = btn->palette();
2076- pal.setColor(QColorGroup::Button,
2077- *customBtnColorList.at(idx));
2078- btn->setPalette(pal);
2079- /*
2080- if(customBtnIconList.at(idx) != NULL){
2081- QPixmap *pix = customBtnIconList.at(idx);
2082- btn->setIconSet(QIconSet(*pix));
2083- }*/
2084- break;
2085- }
2086- }
2087-}
2088-
2089-void LiquidStyle::unapplyCustomAttributes(QPushButton *btn)
2090-{
2091- return; // TODO
2092- QString str = btn->text();
2093- if(str.isEmpty())
2094- return;
2095- while(str.contains('&') != 0)
2096- str = str.remove(str.find('&'), 1);
2097-
2098- const char *s;
2099- for(s = customBtnLabelList.first(); s != NULL; s = customBtnLabelList.next()){
2100- if(qstricmp(s, str.latin1()) == 0){
2101- btn->setPalette(QApplication::palette());
2102- btn->setIconSet(QIconSet());
2103- break;
2104- }
2105- }
2106-}
2107-
1403-#include "liquid.moc" 2108-#include "liquid.moc"
1404+// #include "liquid.moc" 2109-
1405 2110-
1406 2111-
2112-
2113-
1407 2114
1408 --- -2002-10-24 03:19:31.000000000 +0200 2115 /* vim: set noet sw=8 ts=8: */
1409 +++ plugin.cpp2002-10-04 03:37:38.000000000 +0200 2116 --- -2002-11-18 04:47:41.000000000 +0100
1410@@ -1,29 +1,84 @@ 2117 +++ plugin.cpp2002-11-18 03:54:56.000000000 +0100
2118@@ -1,29 +1,79 @@
1411+#include <qapplication.h> 2119+#include <qapplication.h>
1412+ 2120+
1413 #include "liquid.h" 2121 #include "liquid.h"
@@ -1421,64 +2129,66 @@ Features:
1421+{ 2129+{
1422 +m_widget = 0; 2130 +m_widget = 0;
1423+} 2131+}
1424+ 2132
2133-extern "C" {
2134- KStyle* allocate();
2135- int minor_version();
2136- int major_version();
2137- const char *description();
1425+LiquidInterface::~LiquidInterface ( ) 2138+LiquidInterface::~LiquidInterface ( )
1426+{ 2139+{
1427+} 2140 }
1428+ 2141
2142-KStyle* allocate()
1429+QStyle *LiquidInterface::style ( ) 2143+QStyle *LiquidInterface::style ( )
1430+{ 2144 {
2145- return(new LiquidStyle);
1431 +return new LiquidStyle ( ); 2146 +return new LiquidStyle ( );
1432+} 2147 }
1433+ 2148
2149-int minor_version()
1434+QString LiquidInterface::name ( ) const 2150+QString LiquidInterface::name ( ) const
1435+{ 2151 {
2152- return(0);
1436 +return qApp-> translate ( "Styles", "Liquid" ); 2153 +return qApp-> translate ( "Styles", "Liquid" );
1437+} 2154 }
1438+ 2155
2156-int major_version()
1439+QString LiquidInterface::description ( ) const 2157+QString LiquidInterface::description ( ) const
1440+{ 2158 {
2159- return(1);
1441 +return qApp-> translate ( "Styles", "High Performance Liquid style by Mosfet" ); 2160 +return qApp-> translate ( "Styles", "High Performance Liquid style by Mosfet" );
1442+} 2161 }
1443+ 2162
2163-const char *description()
1444+bool LiquidInterface::hasSettings ( ) const 2164+bool LiquidInterface::hasSettings ( ) const
1445+{ 2165 {
2166- return(i18n("High performance liquid plugin").utf8());
1446 +return true; 2167 +return true;
1447+} 2168+}
1448+ 2169+
1449+QWidget *LiquidInterface::create ( QWidget *parent, const char *name ) 2170+QWidget *LiquidInterface::create ( QWidget *parent, const char *name )
1450+{ 2171+{
1451 +m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" ); 2172 +m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" );
1452 2173 +
1453-extern "C" {
1454- KStyle* allocate();
1455- int minor_version();
1456- int major_version();
1457- const char *description();
1458 +return m_widget; 2174 +return m_widget;
1459 } 2175+}
1460 2176+
1461-KStyle* allocate()
1462+bool LiquidInterface::accept ( ) 2177+bool LiquidInterface::accept ( )
1463 { 2178+{
1464- return(new LiquidStyle);
1465 +if ( !m_widget ) 2179 +if ( !m_widget )
1466 + return false; 2180 + return false;
1467+ 2181+
1468 +return m_widget-> writeConfig ( ); 2182 +return m_widget-> writeConfig ( );
1469 } 2183 }
1470 2184+
1471-int minor_version()
1472+void LiquidInterface::reject ( ) 2185+void LiquidInterface::reject ( )
1473 { 2186+{
1474- return(0); 2187+}
1475 } 2188+
1476
1477-int major_version()
1478+ 2189+
1479+QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) 2190+QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
1480 { 2191+{
1481- return(1);
1482 +*iface = 0; 2192 +*iface = 0;
1483 + 2193 +
1484 +if ( uuid == IID_QUnknown ) 2194 +if ( uuid == IID_QUnknown )
@@ -1492,17 +2202,10 @@ Features:
1492 + (*iface)-> addRef ( ); 2202 + (*iface)-> addRef ( );
1493 + 2203 +
1494 +return QS_OK; 2204 +return QS_OK;
1495 } 2205+}
1496 2206+
1497-const char *description()
1498+Q_EXPORT_INTERFACE() 2207+Q_EXPORT_INTERFACE()
1499 { 2208+{
1500- return(i18n("High performance liquid plugin").utf8());
1501 +Q_CREATE_INSTANCE( LiquidInterface ) 2209 +Q_CREATE_INSTANCE( LiquidInterface )
1502 } 2210+}
1503+
1504+
1505+
1506+ 2211+
1507+// Hack for Retail Z experiments
1508+extern "C" { QStyle *allocate ( ) { return new LiquidStyle ( ); } }