summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/liquid/liquid.cpp8
-rw-r--r--noncore/styles/liquid/opie-liquid.diff389
2 files changed, 237 insertions, 160 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp
index eb1ec6e..6812d16 100644
--- a/noncore/styles/liquid/liquid.cpp
+++ b/noncore/styles/liquid/liquid.cpp
@@ -840,13 +840,15 @@ void LiquidStyle::polish(QWidget *w)
840 w->setBackgroundMode(QWidget::PaletteBackground); 840 w->setBackgroundMode(QWidget::PaletteBackground);
841 w->setBackgroundOrigin(QWidget::WidgetOrigin); 841 w->setBackgroundOrigin(QWidget::WidgetOrigin);
842 return; 842 return;
843 } 843 }
844 if(w->inherits("QPopupMenu")) 844 if(w->inherits("QPopupMenu"))
845 w->setBackgroundMode(QWidget::NoBackground); 845 w->setBackgroundMode(QWidget::NoBackground);
846 else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { 846 else if(w-> testWFlags(Qt::WType_Popup) &&
847 !w->inherits("QListBox") &&
848 ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) {
847 w->installEventFilter(menuHandler); 849 w->installEventFilter(menuHandler);
848 } 850 }
849 851
850 if(w->isTopLevel()){ 852 if(w->isTopLevel()){
851 return; 853 return;
852 } 854 }
@@ -941,13 +943,15 @@ void LiquidStyle::unPolish(QWidget *w)
941 w->setBackgroundMode(QWidget::PaletteBackground); 943 w->setBackgroundMode(QWidget::PaletteBackground);
942 return; 944 return;
943 } 945 }
944 946
945 if(w->inherits("QPopupMenu")) 947 if(w->inherits("QPopupMenu"))
946 w->setBackgroundMode(QWidget::PaletteButton); 948 w->setBackgroundMode(QWidget::PaletteButton);
947 else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { 949 else if(w-> testWFlags(Qt::WType_Popup) &&
950 !w->inherits("QListBox") &&
951 ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) {
948 w->removeEventFilter(menuHandler); 952 w->removeEventFilter(menuHandler);
949 } 953 }
950 954
951 if(w->isTopLevel()) 955 if(w->isTopLevel())
952 return; 956 return;
953 957
diff --git a/noncore/styles/liquid/opie-liquid.diff b/noncore/styles/liquid/opie-liquid.diff
index 90ece90..f3531e5 100644
--- a/noncore/styles/liquid/opie-liquid.diff
+++ b/noncore/styles/liquid/opie-liquid.diff
@@ -1,13 +1,13 @@
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 --- -Sat Sep 21 05:31:47 2002 6 --- -2002-10-24 03:19:30.000000000 +0200
7 +++ liquid.hMon Jul 15 02:52:50 2002 7 +++ liquid.h2002-07-15 02:52:50.000000000 +0200
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>
@@ -107,25 +107,25 @@ Features:
107 QPixmap* processEmbedded(const char *label, int h, int s, int v, bool blend=false); 107 QPixmap* processEmbedded(const char *label, int h, int s, int v, bool blend=false);
108 private: 108 private:
109 +bool flatTBButtons; 109 +bool flatTBButtons;
110 bool highcolor; 110 bool highcolor;
111 QColorGroup radioOnGrp; 111 QColorGroup radioOnGrp;
112 QWidget *highlightWidget; 112 QWidget *highlightWidget;
113 --- -Sat Sep 21 05:31:48 2002 113 --- -2002-10-24 03:19:31.000000000 +0200
114 +++ liquid.cppSat Sep 21 05:18:54 2002 114 +++ liquid.cpp2002-10-24 03:18:15.000000000 +0200
115@@ -10,12 +10,10 @@ 115@@ -10,12 +10,10 @@
116 116
117 #include <qmenudata.h> 117 #include <qmenudata.h>
118 #include "liquid.h" 118 #include "liquid.h"
119-#include <kapp.h> 119-#include <kapp.h>
120-#include <kglobal.h> 120-#include <kglobal.h>
121-#include <kconfig.h> 121-#include <kconfig.h>
122-#include <kdrawutil.h> 122-#include <kdrawutil.h>
123-#include <kglobalsettings.h> 123-#include <kglobalsettings.h>
124-#include <kpixmapeffect.h> 124-#include <kpixmapeffect.h>
125+#include "liquiddeco.h" 125+//#include "liquiddeco.h"
126+#include <qapplication.h> 126+#include <qapplication.h>
127+#include <qpe/config.h> 127+#include <qpe/config.h>
128+#include "effects.h" 128+#include "effects.h"
129 #include <qpalette.h> 129 #include <qpalette.h>
130 #include <qbitmap.h> 130 #include <qbitmap.h>
131 #include <qtabbar.h> 131 #include <qtabbar.h>
@@ -143,16 +143,16 @@ Features:
143 #include <unistd.h> 143 #include <unistd.h>
144-#include <klocale.h> 144-#include <klocale.h>
145-#include <kiconloader.h> 145-#include <kiconloader.h>
146-#include <kmenubar.h> 146-#include <kmenubar.h>
147-#include <kipc.h> 147-#include <kipc.h>
148+#include <qmenubar.h> 148+#include <qmenubar.h>
149+#include <qprogressbar.h>
149 150
150-#include <X11/X.h> 151-#include <X11/X.h>
151-#include <X11/Xlib.h> 152-#include <X11/Xlib.h>
152+
153+#include <stdio.h> 153+#include <stdio.h>
154 154
155 #include "htmlmasks.h" 155 #include "htmlmasks.h"
156 #include "embeddata.h" 156 #include "embeddata.h"
157 157
158-void TransMenuHandler::stripePixmap(KPixmap &pix, const QColor &color) 158-void TransMenuHandler::stripePixmap(KPixmap &pix, const QColor &color)
@@ -226,34 +226,33 @@ Features:
226 } 226 }
227- *pix = QPixmap::grabWindow(qt_xrootwin(), r.x(), r.y(), 227- *pix = QPixmap::grabWindow(qt_xrootwin(), r.x(), r.y(),
228+ *pix = QPixmap::grabWindow(QApplication::desktop()-> winId(), r.x(), r.y(), 228+ *pix = QPixmap::grabWindow(QApplication::desktop()-> winId(), r.x(), r.y(),
229 r.width(), r.height()); 229 r.width(), r.height());
230 } 230 }
231 else{ // tear off menu 231 else{ // tear off menu
232@@ -121,82 +122,55 @@ 232@@ -121,82 +122,53 @@
233 stripePixmap(*pix, p->colorGroup().button()); 233 stripePixmap(*pix, p->colorGroup().button());
234 } 234 }
235 else{ 235 else{
236- KPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color); 236- KPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color);
237+ QPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color); 237+ QPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color);
238 } 238 }
239+ 239+
240 pixDict.insert(p->winId(), pix); 240 pixDict.insert(p->winId(), pix);
241+ 241+
242+ if (!p->inherits("QPopupMenu")) { 242+ if ( !p->inherits("QPopupMenu"))
243 + p->setBackgroundPixmap(*pix); 243 + p->setBackgroundPixmap(*pix);
244 + 244 +
245 + QObjectList *ol = p-> queryList("QWidget"); 245+ QObjectList *ol = p-> queryList("QWidget");
246 + for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { 246 + for ( QObjectListIt it( *ol ); it. current ( ); ++it ) {
247 + QWidget *wid = (QWidget *) it.current ( ); 247 + QWidget *wid = (QWidget *) it.current ( );
248 + 248 +
249 + wid-> setBackgroundPixmap(*pix); 249 + wid-> setBackgroundPixmap(*pix);
250 + wid-> setBackgroundOrigin(QWidget::ParentOrigin); 250 + wid-> setBackgroundOrigin(QWidget::ParentOrigin);
251+ } 251+ }
252 + delete ol; 252 + delete ol;
253 + }
254 } 253 }
255 } 254 }
256 else if(ev->type() == QEvent::Hide){ 255 else if(ev->type() == QEvent::Hide){
257 if(type == TransStippleBg || type == TransStippleBtn || 256 if(type == TransStippleBg || type == TransStippleBtn ||
258 type == Custom){ 257 type == Custom){
259- qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width()); 258- qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width());
@@ -282,30 +281,31 @@ Features:
282- ++it; 281- ++it;
283- if(w->inherits("QPopupMenu")){ 282- if(w->inherits("QPopupMenu")){
284- w->close(); 283- w->close();
285- } 284- }
286- } 285- }
287+ pixDict.remove(p->winId()); 286+ pixDict.remove(p->winId());
288+ if (!p->inherits("QPopupMenu")) { 287+ if ( !p->inherits("QPopupMenu"))
289+ p->setBackgroundMode(QWidget::PaletteBackground); 288+ p->setBackgroundMode(QWidget::PaletteBackground);
290 289
291- reloadSettings(); 290- reloadSettings();
292 + QObjectList *ol = p-> queryList("QWidget"); 291 + QObjectList *ol = p-> queryList("QWidget");
293 + for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { 292 + for ( QObjectListIt it( *ol ); it. current ( ); ++it ) {
294 + QWidget *wid = (QWidget *) it.current ( ); 293 + QWidget *wid = (QWidget *) it.current ( );
295 294
296- // Now repaint menubar if needed 295- // Now repaint menubar if needed
297- if(shadowText != oldShadow){ 296- if(shadowText != oldShadow){
298- it.toFirst(); 297- it.toFirst();
299- while ((w=it.current()) != 0 ){ 298- while ((w=it.current()) != 0 ){
300- ++it; 299- ++it;
301- if(w->inherits("QMenuBar")){ 300- if(w->inherits("QMenuBar")){
302- w->repaint(); 301- w->repaint();
303- } 302 + wid-> setBackgroundMode( QWidget::PaletteBackground );
304- } 303 }
305 + wid-> setBackgroundMode( QWidget::PaletteBackground ); 304 + delete ol;
305 }
306 } 306 }
307- } 307- }
308- else if(id == MOSFET_BUTTON_CHANGE){ 308- else if(id == MOSFET_BUTTON_CHANGE){
309- qWarning("In mosfet button change"); 309- qWarning("In mosfet button change");
310- // really, this should be in LiquidStyle, but what the hell? ;-) 310- // really, this should be in LiquidStyle, but what the hell? ;-)
311- QWidgetList *list = QApplication::allWidgets(); 311- QWidgetList *list = QApplication::allWidgets();
@@ -320,17 +320,16 @@ Features:
320- ((LiquidStyle*)parent())->loadCustomButtons(); 320- ((LiquidStyle*)parent())->loadCustomButtons();
321- it.toFirst(); 321- it.toFirst();
322- while ((w=it.current()) != 0 ){ 322- while ((w=it.current()) != 0 ){
323- ++it; 323- ++it;
324- if(w->inherits("QPushButton")){ 324- if(w->inherits("QPushButton")){
325- ((LiquidStyle*)parent())->applyCustomAttributes((QPushButton *)w); 325- ((LiquidStyle*)parent())->applyCustomAttributes((QPushButton *)w);
326 + delete ol; 326- }
327 } 327- }
328 }
329- 328-
330 } 329- }
331+ return(false); 330+ return(false);
332 } 331 }
333 332
334+ 333+
335 LiquidStyle::LiquidStyle() 334 LiquidStyle::LiquidStyle()
336- :KStyle() 335- :KStyle()
@@ -340,21 +339,21 @@ Features:
340+ 339+
341 +flatTBButtons = false; 340 +flatTBButtons = false;
342+ 341+
343 btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); 342 btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true);
344 btnMaskBmp.setMask(btnMaskBmp); 343 btnMaskBmp.setMask(btnMaskBmp);
345 htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); 344 htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true);
346@@ -711,7 +685,6 @@ 345@@ -711,7 +683,6 @@
347 346
348 void LiquidStyle::polish(QPalette &appPal) 347 void LiquidStyle::polish(QPalette &appPal)
349 { 348 {
350- 349-
351 int i; 350 int i;
352 for(i=0; i < BITMAP_ITEMS; ++i){ 351 for(i=0; i < BITMAP_ITEMS; ++i){
353 if(pixmaps[i]){ 352 if(pixmaps[i]){
354@@ -730,20 +703,29 @@ 353@@ -730,20 +701,29 @@
355 } 354 }
356 355
357 loadCustomButtons(); 356 loadCustomButtons();
358- lowLightVal = 100 + (2*KGlobalSettings::contrast()+4)*10; 357- lowLightVal = 100 + (2*KGlobalSettings::contrast()+4)*10;
359+ lowLightVal = 100 + (2* /*KGlobalSettings::contrast()*/ 3 +4)*10; 358+ lowLightVal = 100 + (2* /*KGlobalSettings::contrast()*/ 3 +4)*10;
360 btnDict.clear(); 359 btnDict.clear();
@@ -385,13 +384,13 @@ Features:
385+ if ( c == appPal. color ( QPalette::Active, QColorGroup::Background ) 384+ if ( c == appPal. color ( QPalette::Active, QColorGroup::Background )
386+ //QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( ))) 385+ //QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( )))
387+ ) { 386+ ) {
388 // force button color to be different from background 387 // force button color to be different from background
389 QBrush btnBrush(QColor(200, 202, 228)); 388 QBrush btnBrush(QColor(200, 202, 228));
390 appPal.setBrush(QColorGroup::Button, btnBrush); 389 appPal.setBrush(QColorGroup::Button, btnBrush);
391@@ -794,15 +776,7 @@ 390@@ -794,15 +774,7 @@
392 pagerBrush.setPixmap(*pix); 391 pagerBrush.setPixmap(*pix);
393 392
394 // background color stuff 393 // background color stuff
395- c = config->readColorEntry("background", &Qt::lightGray); 394- c = config->readColorEntry("background", &Qt::lightGray);
396- if(qstrcmp(kapp->argv()[0], "kicker") == 0){ 395- if(qstrcmp(kapp->argv()[0], "kicker") == 0){
397- appPal.setColor(QColorGroup::Mid, menuBrush.color().dark(110)); 396- appPal.setColor(QColorGroup::Mid, menuBrush.color().dark(110));
@@ -402,13 +401,13 @@ Features:
402- appPal.setBrush(QColorGroup::Background, menuBrush); 401- appPal.setBrush(QColorGroup::Background, menuBrush);
403- } 402- }
404+ c = /*QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( )));*/ appPal. color ( QPalette::Active, QColorGroup::Background ); 403+ c = /*QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( )));*/ appPal. color ( QPalette::Active, QColorGroup::Background );
405 c.hsv(&bH, &bS, &bV); 404 c.hsv(&bH, &bS, &bV);
406 c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV); 405 c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV);
407 406
408@@ -817,21 +791,18 @@ 407@@ -817,21 +789,18 @@
409 wallPaper.fill(c.rgb()); 408 wallPaper.fill(c.rgb());
410 painter.begin(&wallPaper); 409 painter.begin(&wallPaper);
411 for(i=0; i < 32; i+=4){ 410 for(i=0; i < 32; i+=4){
412- painter.setPen(c.dark(105)); 411- painter.setPen(c.dark(105));
413+ painter.setPen(c.dark(100 + contrast)); 412+ painter.setPen(c.dark(100 + contrast));
414 painter.drawLine(0, i, 32, i); 413 painter.drawLine(0, i, 32, i);
@@ -427,13 +426,13 @@ Features:
427 // lineedits 426 // lineedits
428- c = config->readColorEntry("windowBackground", &Qt::white); 427- c = config->readColorEntry("windowBackground", &Qt::white);
429+ c = /*QColor ( config. readEntry("Base", ( Qt::white). name ( )));*/ appPal. color ( QPalette::Active, QColorGroup::Base ); 428+ c = /*QColor ( config. readEntry("Base", ( Qt::white). name ( )));*/ appPal. color ( QPalette::Active, QColorGroup::Base );
430 QPixmap basePix; 429 QPixmap basePix;
431 basePix.resize(32, 32); 430 basePix.resize(32, 32);
432 basePix.fill(c.rgb()); 431 basePix.fill(c.rgb());
433@@ -856,52 +827,39 @@ 432@@ -856,52 +825,37 @@
434 applyCustomAttributes((QPushButton *)w); 433 applyCustomAttributes((QPushButton *)w);
435 } 434 }
436 } 435 }
437- 436-
438- config->setGroup(oldGrp); 437- config->setGroup(oldGrp);
439 } 438 }
@@ -453,13 +452,15 @@ Features:
453+ w->setBackgroundMode(QWidget::PaletteBackground); 452+ w->setBackgroundMode(QWidget::PaletteBackground);
454+ w->setBackgroundOrigin(QWidget::WidgetOrigin); 453+ w->setBackgroundOrigin(QWidget::WidgetOrigin);
455 return; 454 return;
456 } 455 }
457 if(w->inherits("QPopupMenu")) 456 if(w->inherits("QPopupMenu"))
458 w->setBackgroundMode(QWidget::NoBackground); 457 w->setBackgroundMode(QWidget::NoBackground);
459+ else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { 458+ else if(w-> testWFlags(Qt::WType_Popup) &&
459+ !w->inherits("QListBox") &&
460+ ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) {
460 + w->installEventFilter(menuHandler); 461 + w->installEventFilter(menuHandler);
461+ } 462+ }
462 463
463 if(w->isTopLevel()){ 464 if(w->isTopLevel()){
464- if(!w->inherits("QPopupMenu") && 465- if(!w->inherits("QPopupMenu") &&
465- qstrcmp(kapp->argv()[0], "kicker") == 0){ 466- qstrcmp(kapp->argv()[0], "kicker") == 0){
@@ -483,93 +484,104 @@ Features:
483 return; 484 return;
484 } 485 }
485- if(qstrcmp(kapp->argv()[0], "kicker") == 0 && 486- if(qstrcmp(kapp->argv()[0], "kicker") == 0 &&
486- w->inherits("KPanelExtension")){ // FIXME - doesn't work 487- w->inherits("KPanelExtension")){ // FIXME - doesn't work
487- w->setPalette(kapp->palette()); 488- w->setPalette(kapp->palette());
488- } 489- }
489+
490+
491+ if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame ))
492 + w-> setBackgroundOrigin ( QWidget::ParentOrigin );
493 490
494 if(w->inherits("QComboBox") || 491- if(w->inherits("QComboBox") ||
492+ if(w->inherits("QComboBox") || w->inherits("QProgressBar") ||
495 w->inherits("QLineEdit") || w->inherits("QRadioButton") || 493 w->inherits("QLineEdit") || w->inherits("QRadioButton") ||
496- w->inherits("QCheckBox") || w->inherits("QScrollBar") || 494- w->inherits("QCheckBox") || w->inherits("QScrollBar") ||
497- w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || 495- w->isA("AppletHandle") || w->inherits("KMiniPagerButton") ||
498- w->inherits("TaskContainer")){ 496- w->inherits("TaskContainer")){
499+ w->inherits("QCheckBox") || w->inherits("QScrollBar")) { 497+ w->inherits("QCheckBox") || w->inherits("QScrollBar")) {
500 w->installEventFilter(this); 498 w->installEventFilter(this);
501 } 499 }
502 if(w->inherits("QLineEdit")){ 500 if(w->inherits("QLineEdit")){
503@@ -913,6 +871,9 @@ 501@@ -913,6 +867,10 @@
504 applyCustomAttributes((QPushButton *)w); 502 applyCustomAttributes((QPushButton *)w);
505 w->installEventFilter(this); 503 w->installEventFilter(this);
506 } 504 }
507+ if(w->inherits("QButton") || w-> inherits("QComboBox")){ 505+ if(w->inherits("QButton") || w-> inherits("QComboBox")){
508 + w-> setBackgroundMode ( QWidget::PaletteBackground ); 506 + w-> setBackgroundMode ( QWidget::PaletteBackground );
507 + w->setBackgroundOrigin ( QWidget::ParentOrigin);
509+ } 508+ }
510 509
511 bool isViewport = qstrcmp(w->name(), "qt_viewport") == 0 || 510 bool isViewport = qstrcmp(w->name(), "qt_viewport") == 0 ||
512 qstrcmp(w->name(), "qt_clipped_viewport") == 0; 511 qstrcmp(w->name(), "qt_clipped_viewport") == 0;
513@@ -942,11 +903,14 @@ 512@@ -942,11 +900,17 @@
514 w->setMouseTracking(true); 513 w->setMouseTracking(true);
515 w->installEventFilter(this); 514 w->installEventFilter(this);
516 } 515 }
517+ if(w-> inherits("QToolButton")&&w->parent()->inherits("QToolBar")) { 516+ if(w-> inherits("QToolButton")&&w->parent()->inherits("QToolBar")) {
518 + ((QToolButton*)w)->setAutoRaise (flatTBButtons); 517 + ((QToolButton*)w)->setAutoRaise (flatTBButtons);
519 + if ( flatTBButtons ) 518 + if ( flatTBButtons )
520 + w->setBackgroundOrigin(QWidget::ParentOrigin); 519 + w->setBackgroundOrigin(QWidget::ParentOrigin);
521+ } 520+ }
521+ if(w-> inherits("QToolBarSeparator")&&w->parent()->inherits("QToolBar")) {
522 + ((QFrame *) w)-> setFrameShape ( QFrame::NoFrame );
523+ }
522 if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){ 524 if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){
523 return; 525 return;
524 } 526 }
525- if(w->inherits("PanelButtonBase")) 527- if(w->inherits("PanelButtonBase"))
526- return; 528- return;
527 529
528 if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())-> 530 if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())->
529 palette().active().brush(QColorGroup::Background).pixmap()){ 531 palette().active().brush(QColorGroup::Background).pixmap()){
530@@ -954,17 +918,13 @@ 532@@ -954,16 +918,21 @@
531 return; 533 return;
532 } 534 }
533 if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) && 535 if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) &&
534- !w->inherits("KDesktop") && !w->inherits("PasswordDlg")){ 536- !w->inherits("KDesktop") && !w->inherits("PasswordDlg")){
535 + !( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) { 537 + !( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) {
536 if(w->backgroundMode() == QWidget::PaletteBackground || 538 if(w->backgroundMode() == QWidget::PaletteBackground ||
537 w->backgroundMode() == QWidget::PaletteButton){ 539 w->backgroundMode() == QWidget::PaletteButton){
538 w->setBackgroundMode(QWidget::X11ParentRelative); 540- w->setBackgroundMode(QWidget::X11ParentRelative);
541+ w->setBackgroundMode(w->parentWidget()->backgroundMode( )/*QWidget::X11ParentRelative*/);
542+ w->setBackgroundOrigin(QWidget::ParentOrigin);
543 +// w->setBackgroundMode(QWidget::NoBackground);
539 } 544 }
540 } 545 }
541- if(w->inherits("KToolBar")){ 546- if(w->inherits("KToolBar")){
542- w->installEventFilter(this); 547- w->installEventFilter(this);
543- //w->setBackgroundMode(QWidget::NoBackground); 548- //w->setBackgroundMode(QWidget::NoBackground);
544- return; 549- return;
545- } 550+ if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame ))
551 + w-> setBackgroundOrigin ( QWidget::ParentOrigin );
552 +else if ( w-> inherits("QFrame") )
553 + w->setBackgroundOrigin ( QWidget::WidgetOrigin );
546+ 554+
555 +if ( w->parentWidget()->inherits ( "QWidgetStack" )) {
556 + w->setBackgroundOrigin ( QWidget::WidgetOrigin );
557 }
547 } 558 }
548 559
549 void LiquidStyle::unPolish(QWidget *w) 560@@ -977,6 +946,11 @@
550@@ -977,6 +937,9 @@
551 561
552 if(w->inherits("QPopupMenu")) 562 if(w->inherits("QPopupMenu"))
553 w->setBackgroundMode(QWidget::PaletteButton); 563 w->setBackgroundMode(QWidget::PaletteButton);
554+ else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { 564+ else if(w-> testWFlags(Qt::WType_Popup) &&
565+ !w->inherits("QListBox") &&
566+ ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) {
555 + w->removeEventFilter(menuHandler); 567 + w->removeEventFilter(menuHandler);
556+ } 568+ }
557 569
558 if(w->isTopLevel()) 570 if(w->isTopLevel())
559 return; 571 return;
560@@ -986,7 +949,7 @@ 572@@ -986,7 +960,7 @@
561 ((qstrcmp(w->parent()->name(), "qt_viewport") == 0) || 573 ((qstrcmp(w->parent()->name(), "qt_viewport") == 0) ||
562 (qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0)); 574 (qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0));
563 575
564- w->setPalette(QApplication::palette()); 576- w->setPalette(QApplication::palette());
565+ w->unsetPalette(); 577+ w->unsetPalette();
566 if(w->backgroundMode() == QWidget::X11ParentRelative || isViewportChild){ 578 if(w->backgroundMode() == QWidget::X11ParentRelative || isViewportChild){
567 if(w->inherits("QPushButton")) 579 if(w->inherits("QPushButton"))
568 w->setBackgroundMode(QWidget::PaletteButton); 580 w->setBackgroundMode(QWidget::PaletteButton);
569@@ -1001,12 +964,14 @@ 581@@ -1001,12 +975,14 @@
570 unapplyCustomAttributes((QPushButton *)w); 582 unapplyCustomAttributes((QPushButton *)w);
571 w->removeEventFilter(this); 583 w->removeEventFilter(this);
572 } 584 }
573- 585-
574+/* 586+/*
575+ if(w->inherits("QPushButton") || w-> inherits("QComboBox")){ 587+ if(w->inherits("QPushButton") || w-> inherits("QComboBox")){
@@ -582,25 +594,25 @@ Features:
582- w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || 594- w->isA("AppletHandle") || w->inherits("KMiniPagerButton") ||
583- w->inherits("TaskContainer")){ 595- w->inherits("TaskContainer")){
584+ w->inherits("QCheckBox") || w->inherits("QScrollBar")) { 596+ w->inherits("QCheckBox") || w->inherits("QScrollBar")) {
585 w->removeEventFilter(this); 597 w->removeEventFilter(this);
586 } 598 }
587 if(w->inherits("QButton") || w->inherits("QComboBox")){ 599 if(w->inherits("QButton") || w->inherits("QComboBox")){
588@@ -1014,9 +979,9 @@ 600@@ -1014,9 +990,9 @@
589 w->setAutoMask(false); 601 w->setAutoMask(false);
590 } 602 }
591 } 603 }
592- if(w->inherits("KToolBar")){ 604- if(w->inherits("KToolBar")){
593+ if(w->inherits("QToolBar")){ 605+ if(w->inherits("QToolBar")){
594 w->removeEventFilter(this); 606 w->removeEventFilter(this);
595- //w->setBackgroundMode(QWidget::PaletteBackground); 607- //w->setBackgroundMode(QWidget::PaletteBackground);
596+ w->setBackgroundMode(QWidget::PaletteBackground); 608+ w->setBackgroundMode(QWidget::PaletteBackground);
597 return; 609 return;
598 } 610 }
599 if(w->inherits("QHeader")){ 611 if(w->inherits("QHeader")){
600@@ -1028,20 +993,34 @@ 612@@ -1028,22 +1004,98 @@
601 void LiquidStyle::polish(QApplication *app) 613 void LiquidStyle::polish(QApplication *app)
602 { 614 {
603 615
604- KStyle::polish(app); 616- KStyle::polish(app);
605+ QWindowsStyle::polish(app); 617+ QWindowsStyle::polish(app);
606 menuAni = app->isEffectEnabled(UI_AnimateMenu); 618 menuAni = app->isEffectEnabled(UI_AnimateMenu);
@@ -630,23 +642,87 @@ Features:
630+ 642+
631+ qt_set_draw_menu_bar_impl ( 0 ); 643+ qt_set_draw_menu_bar_impl ( 0 );
632+ 644+
633+// QApplication::qwsSetDecoration ( new QPEDecoration ( )); 645+// QApplication::qwsSetDecoration ( new QPEDecoration ( ));
634 } 646 }
635 647
648+
649+/* !! HACK !! Beware
650+ *
651+ * TT forgot to make the QProgressBar widget styleable in Qt 2.x
652+ * So the only way to customize the drawing, is to intercept the
653+ * paint event - since we have to use protected functions, we need
654+ * to derive a "hack" class from QProgressBar and do the painting
655+ * in there.
656+ *
657+ * - sandman
658+ */
659+
660+class HackProgressBar : public QProgressBar {
661+public:
662 +HackProgressBar ( );
663 +
664 +void paint ( QPaintEvent *event, const QColorGroup &g, QPixmap *pix )
665 +{
666 + QPainter p( this );
667+
668 + if ( !contentsRect().contains( event->rect() ) ) {
669 + p.save();
670 + p.setClipRegion( event->region().intersect(frameRect()) );
671 + drawFrame( &p);
672 + p.restore();
673 + }
674 + if ( event->rect().intersects( contentsRect() )) {
675 + p.setClipRegion( event->region().intersect( contentsRect() ) );
676+
677 + int x, y, w, h;
678 + contentsRect ( ). rect ( &x, &y, &w, &h );
679+
680 + int prog = progress ( );
681 + int total = totalSteps ( );
682 + if ( prog < 0 )
683 + prog = 0;
684 + if ( total <= 0 )
685 + total = 1;
686 + int bw = w * prog / total;
687 + if ( bw > w )
688 + bw = w;
689+
690 + p.setPen(g.button().dark(130));
691 + p.drawRect(x, y, bw, h);
692 + p.setPen(g.button().light(120));
693 + p.drawRect(x+1, y+1, bw-2, h-2);
694+
695 + if(bw >= 4 && h >= 4 && pix)
696 + p.drawTiledPixmap(x+2, y+2, bw-4, h-4, *pix);
697 +
698 + if ( progress ( )>= 0 && totalSteps ( ) > 0 ) {
699 + QString pstr;
700 + pstr. sprintf ( "%d%%", 100 * progress()/totalSteps ());
701 + p. setPen ( g.text());//g.highlightedText ( ));
702 + p. drawText (x,y,w-1,h-1,AlignCenter,pstr);
703 + }
704 + }
705 +}
706+};
707+
708+
709+
636 /* 710 /*
637@@ -1063,7 +1042,7 @@ 711 * 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
713@@ -1063,7 +1115,7 @@
638 */ 714 */
639 bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) 715 bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev)
640 { 716 {
641- if(obj->inherits("KToolBar")){ 717- if(obj->inherits("KToolBar")){
642+ if(obj->inherits("QToolBar")){ 718+ if(obj->inherits("QToolBar")){
643 if(ev->type() == QEvent::Resize){ 719 if(ev->type() == QEvent::Resize){
644 const QObjectList *tbChildList = obj->children(); 720 const QObjectList *tbChildList = obj->children();
645 QObjectListIt it(*tbChildList); 721 QObjectListIt it(*tbChildList);
646@@ -1076,35 +1055,7 @@ 722@@ -1076,35 +1128,7 @@
647 723
648 } 724 }
649 } 725 }
650- else if(obj->inherits("KMiniPagerButton")){ 726- else if(obj->inherits("KMiniPagerButton")){
651- QButton *btn = (QButton *)obj; 727- QButton *btn = (QButton *)obj;
652- if(ev->type() == QEvent::Paint){ 728- if(ev->type() == QEvent::Paint){
@@ -677,13 +753,13 @@ Features:
677- else if(obj->inherits("QPushButton") || obj->inherits("QComboBox") || 753- else if(obj->inherits("QPushButton") || obj->inherits("QComboBox") ||
678- obj->isA("AppletHandle")){ 754- obj->isA("AppletHandle")){
679+ else if(obj->inherits("QPushButton") || obj->inherits("QComboBox")){ 755+ else if(obj->inherits("QPushButton") || obj->inherits("QComboBox")){
680 QWidget *btn = (QWidget *)obj; 756 QWidget *btn = (QWidget *)obj;
681 if(ev->type() == QEvent::Enter){ 757 if(ev->type() == QEvent::Enter){
682 if(btn->isEnabled()){ 758 if(btn->isEnabled()){
683@@ -1119,20 +1070,7 @@ 759@@ -1119,20 +1143,7 @@
684 } 760 }
685 } 761 }
686 } 762 }
687- else if(obj->inherits("TaskContainer")){ 763- else if(obj->inherits("TaskContainer")){
688- QButton *btn = (QButton *)obj; 764- QButton *btn = (QButton *)obj;
689- QPalette pal = btn->palette(); 765- QPalette pal = btn->palette();
@@ -699,52 +775,78 @@ Features:
699- } 775- }
700- else if(obj->inherits("QToolButton") && !obj->inherits("KToolBarButton")){ 776- else if(obj->inherits("QToolButton") && !obj->inherits("KToolBarButton")){
701+ else if(obj->inherits("QToolButton")){ 777+ else if(obj->inherits("QToolButton")){
702 QToolButton *btn = (QToolButton *)btn; 778 QToolButton *btn = (QToolButton *)btn;
703 if(!btn->autoRaise()){ 779 if(!btn->autoRaise()){
704 if(btn->isEnabled()){ 780 if(btn->isEnabled()){
705@@ -1340,11 +1278,6 @@ 781@@ -1290,7 +1301,24 @@
782 }
783 }
784 }
785- return(false);
786+ else if (obj-> inherits( "QProgressBar" )) {
787 + if ( ev->type() == QEvent::Paint ) {
788 + HackProgressBar *p = (HackProgressBar *) obj;
789 + const QColorGroup &g = p-> colorGroup ( );
790 +
791 + QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb());
792 + if(!pix){
793 + int h, s, v;
794 + g.button().dark(120).hsv(&h, &s, &v);
795 + pix = new QPixmap(*bevelFillPix);
796 + adjustHSV(*pix, h, s, v);
797 + bevelFillDict.insert(g.button().dark(120).rgb(), pix);
798 + }
799 + p-> paint ((QPaintEvent *) ev, g, pix );
800 + return true;
801 + }
802 + }
803 +return false ;
804 }
805
806 void LiquidStyle::drawButton(QPainter *p, int x, int y, int w, int h,
807@@ -1340,11 +1368,6 @@
706 QColorGroup g = btn->colorGroup(); 808 QColorGroup g = btn->colorGroup();
707 809
708 810
709- QColor testColor; 811- QColor testColor;
710- if(btn->parent() && btn->parent()->isWidgetType()){ 812- if(btn->parent() && btn->parent()->isWidgetType()){
711- testColor = p->backgroundColor(); // remove me 813- testColor = p->backgroundColor(); // remove me
712- } 814- }
713- 815-
714 //int dw = buttonDefaultIndicatorWidth(); 816 //int dw = buttonDefaultIndicatorWidth();
715 if(btn->hasFocus() || btn->isDefault()){ 817 if(btn->hasFocus() || btn->isDefault()){
716 QColor c = btn->hasFocus() ? g.button().light(110) : g.background(); 818 QColor c = btn->hasFocus() ? g.button().light(110) : g.background();
717@@ -1596,7 +1529,7 @@ 819@@ -1596,7 +1619,7 @@
718 if(sbBuffer.size() != sb->size()) 820 if(sbBuffer.size() != sb->size())
719 sbBuffer.resize(sb->size()); 821 sbBuffer.resize(sb->size());
720 } 822 }
721- subB.setRect( subX,subY,buttonDim,buttonDim ); 823- subB.setRect( subX,subY,buttonDim,buttonDim );
722+ subB.setRect( subX,subY,0,0); // buttonDim,buttonDim ); 824+ subB.setRect( subX,subY,0,0); // buttonDim,buttonDim );
723 addB.setRect( addX,addY,buttonDim,buttonDim ); 825 addB.setRect( addX,addY,buttonDim,buttonDim );
724 if(horiz) 826 if(horiz)
725 subHC.setRect(addX-buttonDim,addY,buttonDim,buttonDim ); 827 subHC.setRect(addX-buttonDim,addY,buttonDim,buttonDim );
726@@ -1624,7 +1557,7 @@ 828@@ -1624,7 +1647,7 @@
727 QPainter painter; 829 QPainter painter;
728 if(!horiz){ 830 if(!horiz){
729 painter.begin(&sbBuffer); 831 painter.begin(&sbBuffer);
730- QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*3))+1); 832- QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*3))+1);
731+ QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*2))+1); 833+ QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*2))+1);
732 if(sliderR.height() >= 8){ 834 if(sliderR.height() >= 8){
733 painter.drawPixmap(bgR.x()+1, bgR.y(), *vsbSliderFillPix, 0, 0, 835 painter.drawPixmap(bgR.x()+1, bgR.y(), *vsbSliderFillPix, 0, 0,
734 13, 8); 836 13, 8);
735@@ -1690,7 +1623,7 @@ 837@@ -1690,7 +1713,7 @@
736 } 838 }
737 else{ 839 else{
738 painter.begin(&sbBuffer); 840 painter.begin(&sbBuffer);
739- QRect bgR(subB.right()+1, 0, (len-(buttonDim*3))+1, sb->height()); 841- QRect bgR(subB.right()+1, 0, (len-(buttonDim*3))+1, sb->height());
740+ QRect bgR(subB.right()+1, 0, (len-(buttonDim*2))+1, sb->height()); 842+ QRect bgR(subB.right()+1, 0, (len-(buttonDim*2))+1, sb->height());
741 if(sliderR.width() >= 8){ 843 if(sliderR.width() >= 8){
742 painter.drawPixmap(bgR.x(), bgR.y()+1, *vsbSliderFillPix, 0, 0, 844 painter.drawPixmap(bgR.x(), bgR.y()+1, *vsbSliderFillPix, 0, 0,
743 8, 13); 845 8, 13);
744@@ -1761,10 +1694,10 @@ 846@@ -1761,10 +1784,10 @@
745 addB.width()-8, addB.height()-8, g, !maxed); 847 addB.width()-8, addB.height()-8, g, !maxed);
746 } 848 }
747 if ( controls & SubLine ) { 849 if ( controls & SubLine ) {
748- drawSBButton(p, subB, g, activeControl == SubLine); 850- drawSBButton(p, subB, g, activeControl == SubLine);
749- drawArrow( p, horiz ? LeftArrow : UpArrow, 851- drawArrow( p, horiz ? LeftArrow : UpArrow,
750- false, subB.x()+4, subB.y()+4, 852- false, subB.x()+4, subB.y()+4,
@@ -753,57 +855,57 @@ Features:
753+ // drawArrow( p, horiz ? LeftArrow : UpArrow, 855+ // drawArrow( p, horiz ? LeftArrow : UpArrow,
754+ // false, subB.x()+4, subB.y()+4, 856+ // false, subB.x()+4, subB.y()+4,
755+ // subB.width()-8, subB.height()-8, g, !maxed); 857+ // subB.width()-8, subB.height()-8, g, !maxed);
756 drawSBButton(p, subHC, g, activeControl == SubLine); 858 drawSBButton(p, subHC, g, activeControl == SubLine);
757 drawArrow( p, horiz ? LeftArrow : UpArrow, 859 drawArrow( p, horiz ? LeftArrow : UpArrow,
758 false, subHC.x()+4, subHC.y()+4, 860 false, subHC.x()+4, subHC.y()+4,
759@@ -1865,8 +1798,8 @@ 861@@ -1865,8 +1888,8 @@
760 else 862 else
761 buttonDim = ( length - b*2 )/2 - 1; 863 buttonDim = ( length - b*2 )/2 - 1;
762 864
763- sliderMin = b + buttonDim; 865- sliderMin = b + buttonDim;
764- maxLength = length - b*2 - buttonDim*3; 866- maxLength = length - b*2 - buttonDim*3;
765+ sliderMin = b + 0; // buttonDim; 867+ sliderMin = b + 0; // buttonDim;
766+ maxLength = length - b*2 - buttonDim*2; // 3; 868+ maxLength = length - b*2 - buttonDim*2; // 3;
767 869
768 if ( sb->maxValue() == sb->minValue() ) { 870 if ( sb->maxValue() == sb->minValue() ) {
769 sliderLength = maxLength; 871 sliderLength = maxLength;
770@@ -1914,8 +1847,8 @@ 872@@ -1914,8 +1937,8 @@
771 return(QSize(16, 16)); 873 return(QSize(16, 16));
772 } 874 }
773 875
774-void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int w, 876-void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int w,
775- int h, const QColorGroup &g, bool on, 877- int h, const QColorGroup &g, bool on,
776+void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int /*w*/, 878+void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int /*w*/,
777+ int /*h*/, const QColorGroup &/*g*/, bool on, 879+ int /*h*/, const QColorGroup &/*g*/, bool on,
778 bool down, bool) 880 bool down, bool)
779 { 881 {
780 bool isHover = highlightWidget == p->device(); 882 bool isHover = highlightWidget == p->device();
781@@ -1957,8 +1890,8 @@ 883@@ -1957,8 +1980,8 @@
782 return(QSize(20, 22)); 884 return(QSize(20, 22));
783 } 885 }
784 886
785-void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int w, int h, 887-void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int w, int h,
786- const QColorGroup &g, int state, bool down, bool) 888- const QColorGroup &g, int state, bool down, bool)
787+void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int /*w*/, int /*h*/, 889+void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int /*w*/, int /*h*/,
788+ const QColorGroup &/*g*/, int state, bool /*down*/, bool) 890+ const QColorGroup &/*g*/, int state, bool /*down*/, bool)
789 { 891 {
790 bool isHover = highlightWidget == p->device(); 892 bool isHover = highlightWidget == p->device();
791 bool isMasked = p->device() && p->device()->devType() == QInternal::Widget 893 bool isMasked = p->device() && p->device()->devType() == QInternal::Widget
792@@ -1996,8 +1929,8 @@ 894@@ -1996,8 +2019,8 @@
793 } 895 }
794 } 896 }
795 897
796-void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int w, int h, 898-void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int w, int h,
797- int state) 899- int state)
798+void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, 900+void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int /*w*/, int /*h*/,
799+ int /*state*/) 901+ int /*state*/)
800 { 902 {
801 // needed for some reason by KHtml, even tho it's all filled ;P 903 // needed for some reason by KHtml, even tho it's all filled ;P
802 p->drawPixmap(x, y, *getPixmap(HTMLCB)->mask()); 904 p->drawPixmap(x, y, *getPixmap(HTMLCB)->mask());
803@@ -2005,18 +1938,17 @@ 905@@ -2005,18 +2028,17 @@
804 } 906 }
805 907
806 void LiquidStyle::drawSlider(QPainter *p, int x, int y, int w, int h, 908 void LiquidStyle::drawSlider(QPainter *p, int x, int y, int w, int h,
807- const QColorGroup &g, Orientation orient, 909- const QColorGroup &g, Orientation orient,
808+ const QColorGroup &/*g*/, Orientation orient, 910+ const QColorGroup &/*g*/, Orientation orient,
809 bool, bool) 911 bool, bool)
@@ -819,13 +921,13 @@ Features:
819 921
820-void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int w, int h, 922-void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int w, int h,
821+void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, 923+void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int /*w*/, int /*h*/,
822 Orientation orient, bool, bool) 924 Orientation orient, bool, bool)
823 { 925 {
824 p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() : 926 p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() :
825@@ -2065,203 +1997,26 @@ 927@@ -2065,203 +2087,26 @@
826 p->drawLineSegments(a); 928 p->drawLineSegments(a);
827 } 929 }
828 930
829-void LiquidStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h, 931-void LiquidStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h,
830- const QColorGroup &g, KToolBarPos, 932- const QColorGroup &g, KToolBarPos,
831- QBrush *) 933- QBrush *)
@@ -841,13 +943,13 @@ Features:
841- p->setPen(g.background()); 943- p->setPen(g.background());
842- p->drawPoint(x, y); 944- p->drawPoint(x, y);
843- p->drawPoint(x2, y); 945- p->drawPoint(x2, y);
844- p->drawPoint(x, y2); 946- p->drawPoint(x, y2);
845- p->drawPoint(x2, y2); 947- p->drawPoint(x2, y2);
846- 948-
847- 949
848- 950-
849- // p->drawRect(x, y, w, h); 951- // p->drawRect(x, y, w, h);
850- QPixmap *pix = bevelFillDict.find(g.button().rgb()); 952- QPixmap *pix = bevelFillDict.find(g.button().rgb());
851- if(!pix){ 953- if(!pix){
852- int h, s, v; 954- int h, s, v;
853- g.button().hsv(&h, &s, &v); 955- g.button().hsv(&h, &s, &v);
@@ -858,13 +960,15 @@ Features:
858- 960-
859- p->drawTiledPixmap(x+1, y+1, w-2, h-2, *pix); 961- p->drawTiledPixmap(x+1, y+1, w-2, h-2, *pix);
860-} 962-}
861- 963-
862-void LiquidStyle::drawKMenuBar(QPainter *p, int x, int y, int w, int h, 964-void LiquidStyle::drawKMenuBar(QPainter *p, int x, int y, int w, int h,
863- const QColorGroup &g, bool mac, QBrush *) 965- const QColorGroup &g, bool mac, QBrush *)
864-{ 966+void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h,
967+ QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active )
968 {
865- if(p->device() && p->device()->devType() == QInternal::Widget && 969- if(p->device() && p->device()->devType() == QInternal::Widget &&
866- ((KMenuBar *)p->device())->isTopLevelMenu()){ 970- ((KMenuBar *)p->device())->isTopLevelMenu()){
867- p->setPen(Qt::black); 971- p->setPen(Qt::black);
868- p->drawRect(x, y, w, h); 972- p->drawRect(x, y, w, h);
869- p->drawTiledPixmap(x+1, y+1, w-2, h-2, *menuPix); 973- p->drawTiledPixmap(x+1, y+1, w-2, h-2, *menuPix);
870- // left 974- // left
@@ -882,18 +986,16 @@ Features:
882- else{ 986- else{
883- qDrawShadePanel(p, x, y, w, h, g, false, 1, 987- qDrawShadePanel(p, x, y, w, h, g, false, 1,
884- &g.brush(QColorGroup::Background)); 988- &g.brush(QColorGroup::Background));
885- } 989- }
886- 990-
887-} 991-}
888 992-
889-void LiquidStyle::drawKToolBar(QPainter *p, int x, int y, int w, int h, 993-void LiquidStyle::drawKToolBar(QPainter *p, int x, int y, int w, int h,
890- const QColorGroup &g, KToolBarPos, QBrush *) 994- const QColorGroup &g, KToolBarPos, QBrush *)
891+void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, 995-{
892+ QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active )
893 {
894- //p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); 996- //p->fillRect(x, y, w, h, g.brush(QColorGroup::Background));
895-} 997-}
896- 998-
897-void LiquidStyle::drawKToolBarButton(QPainter *p, int x, int y, int w, int h, 999-void LiquidStyle::drawKToolBarButton(QPainter *p, int x, int y, int w, int h,
898- const QColorGroup &g, bool sunken, 1000- const QColorGroup &g, bool sunken,
899- bool raised, bool enabled, bool popup, 1001- bool raised, bool enabled, bool popup,
@@ -1035,42 +1137,42 @@ Features:
1035- shadow = ((KMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : 1137- shadow = ((KMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) :
1036+ ((QWidget *)p->device())->inherits("QMenuBar")){ 1138+ ((QWidget *)p->device())->inherits("QMenuBar")){
1037+ shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : 1139+ shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) :
1038 g.background().dark(130); 1140 g.background().dark(130);
1039 } 1141 }
1040 else 1142 else
1041@@ -2300,8 +2055,8 @@ 1143@@ -2300,8 +2145,8 @@
1042 } 1144 }
1043 1145
1044 void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h, 1146 void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h,
1045- const QColorGroup &g, int lineWidth, 1147- const QColorGroup &g, int lineWidth,
1046- const QBrush * fill) 1148- const QBrush * fill)
1047+ const QColorGroup &g, int /*lineWidth*/, 1149+ const QColorGroup &g, int /*lineWidth*/,
1048+ const QBrush * /*fill*/) 1150+ const QBrush * /*fill*/)
1049 { 1151 {
1050 QColor c; 1152 QColor c;
1051 switch(menuHandler->transType()){ 1153 switch(menuHandler->transType()){
1052@@ -2336,8 +2091,6 @@ 1154@@ -2336,8 +2181,6 @@
1053 1155
1054 maxpmw = QMAX( maxpmw, 20 ); 1156 maxpmw = QMAX( maxpmw, 20 );
1055 1157
1056- if ( p->font() == KGlobalSettings::generalFont() ) 1158- if ( p->font() == KGlobalSettings::generalFont() )
1057- p->setFont( KGlobalSettings::menuFont() ); 1159- p->setFont( KGlobalSettings::menuFont() );
1058 1160
1059 bool dis = !enabled; 1161 bool dis = !enabled;
1060 QColorGroup itemg = dis ? pal.disabled() : pal.active(); 1162 QColorGroup itemg = dis ? pal.disabled() : pal.active();
1061@@ -2363,7 +2116,7 @@ 1163@@ -2363,7 +2206,7 @@
1062 p->fillRect(x, y, w, h, menuBrush); 1164 p->fillRect(x, y, w, h, menuBrush);
1063 } 1165 }
1064 else{ 1166 else{
1065- KPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); 1167- KPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId());
1066+ QPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); 1168+ QPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId());
1067 if(pix) 1169 if(pix)
1068 p->drawPixmap(x, y, *pix, x, y, w, h); 1170 p->drawPixmap(x, y, *pix, x, y, w, h);
1069 } 1171 }
1070@@ -2508,25 +2261,6 @@ 1172@@ -2508,25 +2351,6 @@
1071 return h; 1173 return h;
1072 } 1174 }
1073 1175
1074-void LiquidStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h, 1176-void LiquidStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h,
1075- const QColorGroup &g, QBrush *fill) 1177- const QColorGroup &g, QBrush *fill)
1076-{ 1178-{
@@ -1090,13 +1192,13 @@ Features:
1090- p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix); 1192- p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix);
1091- } 1193- }
1092-} 1194-}
1093 1195
1094 void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r, 1196 void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r,
1095 const QColorGroup &g, const QColor *c, 1197 const QColorGroup &g, const QColor *c,
1096@@ -2540,25 +2274,25 @@ 1198@@ -2540,25 +2364,25 @@
1097 return; 1199 return;
1098 } 1200 }
1099 else{ 1201 else{
1100- KStyle::drawFocusRect(p, r, g, c, atBorder); 1202- KStyle::drawFocusRect(p, r, g, c, atBorder);
1101+ QWindowsStyle::drawFocusRect(p, r, g, c, atBorder); 1203+ QWindowsStyle::drawFocusRect(p, r, g, c, atBorder);
1102 } 1204 }
@@ -1120,31 +1222,31 @@ Features:
1120 if(tabBar->shape() != QTabBar::RoundedAbove){ 1222 if(tabBar->shape() != QTabBar::RoundedAbove){
1121- KStyle::drawTab(p, tabBar, tab, selected); 1223- KStyle::drawTab(p, tabBar, tab, selected);
1122+ QWindowsStyle::drawTab(p, tabBar, tab, selected); 1224+ QWindowsStyle::drawTab(p, tabBar, tab, selected);
1123 return; 1225 return;
1124 } 1226 }
1125 QPixmap tilePix; 1227 QPixmap tilePix;
1126@@ -2671,7 +2405,7 @@ 1228@@ -2671,7 +2495,7 @@
1127 vFrame = 8; // was 10 1229 vFrame = 8; // was 10
1128 } 1230 }
1129 else 1231 else
1130- KStyle::tabbarMetrics(t, hFrame, vFrame, overlap); 1232- KStyle::tabbarMetrics(t, hFrame, vFrame, overlap);
1131+ QWindowsStyle::tabbarMetrics(t, hFrame, vFrame, overlap); 1233+ QWindowsStyle::tabbarMetrics(t, hFrame, vFrame, overlap);
1132 } 1234 }
1133 1235
1134 1236
1135@@ -2699,7 +2433,7 @@ 1237@@ -2699,7 +2523,7 @@
1136 p->drawLine(x+1, y+1, x+1, y2-1); 1238 p->drawLine(x+1, y+1, x+1, y2-1);
1137 } 1239 }
1138 else if(lineWidth != 2 || !sunken) 1240 else if(lineWidth != 2 || !sunken)
1139- KStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); 1241- KStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill);
1140+ QWindowsStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); 1242+ QWindowsStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill);
1141 else{ 1243 else{
1142 QPen oldPen = p->pen(); 1244 QPen oldPen = p->pen();
1143 int x2 = x+w-1; 1245 int x2 = x+w-1;
1144@@ -2726,105 +2460,6 @@ 1246@@ -2726,105 +2550,6 @@
1145 } 1247 }
1146 } 1248 }
1147 1249
1148-void LiquidStyle::drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h, 1250-void LiquidStyle::drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h,
1149- const QColorGroup &g, QBrush *) 1251- const QColorGroup &g, QBrush *)
1150-{ 1252-{
@@ -1244,13 +1346,13 @@ Features:
1244- } 1346- }
1245- 1347-
1246-} 1348-}
1247 1349
1248 void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v) 1350 void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v)
1249 { 1351 {
1250@@ -2998,22 +2633,22 @@ 1352@@ -2998,22 +2723,22 @@
1251 customBtnIconList.clear(); 1353 customBtnIconList.clear();
1252 customBtnLabelList.clear(); 1354 customBtnLabelList.clear();
1253 1355
1254- KConfig *config = KGlobal::config(); 1356- KConfig *config = KGlobal::config();
1255- QString oldGrp = config->group(); 1357- QString oldGrp = config->group();
1256- config->setGroup("MosfetButtons"); 1358- config->setGroup("MosfetButtons");
@@ -1274,162 +1376,133 @@ Features:
1274 1376
1275- KIconLoader *ldr = KGlobal::iconLoader(); 1377- KIconLoader *ldr = KGlobal::iconLoader();
1276+// KIconLoader *ldr = KGlobal::iconLoader(); 1378+// KIconLoader *ldr = KGlobal::iconLoader();
1277 while(labelStr != NULL){ 1379 while(labelStr != NULL){
1278 QColor *c = new QColor; 1380 QColor *c = new QColor;
1279 c->setNamedColor(QString(colorStr)); 1381 c->setNamedColor(QString(colorStr));
1280@@ -3022,7 +2657,7 @@ 1382@@ -3022,7 +2747,7 @@
1281 QString tmpStr(iconStr); 1383 QString tmpStr(iconStr);
1282 if(!tmpStr.isEmpty()){ 1384 if(!tmpStr.isEmpty()){
1283 QPixmap *pixmap = 1385 QPixmap *pixmap =
1284- new QPixmap(ldr->loadIcon(tmpStr, KIcon::Small)); 1386- new QPixmap(ldr->loadIcon(tmpStr, KIcon::Small));
1285+ new QPixmap();//ldr->loadIcon(tmpStr, KIcon::Small)); 1387+ new QPixmap();//ldr->loadIcon(tmpStr, KIcon::Small));
1286 if(pixmap->isNull()){ 1388 if(pixmap->isNull()){
1287 delete pixmap; 1389 delete pixmap;
1288 customBtnIconList.append(NULL); 1390 customBtnIconList.append(NULL);
1289@@ -3037,7 +2672,6 @@ 1391@@ -3037,7 +2762,6 @@
1290 colorStr = colorList.next(); 1392 colorStr = colorList.next();
1291 iconStr = iconList.next(); 1393 iconStr = iconList.next();
1292 } 1394 }
1293- config->setGroup(oldGrp); 1395- config->setGroup(oldGrp);
1294 } 1396 }
1295 1397
1296 void LiquidStyle::applyCustomAttributes(QPushButton *btn) 1398 void LiquidStyle::applyCustomAttributes(QPushButton *btn)
1297@@ -3087,7 +2721,7 @@ 1399@@ -3087,7 +2811,7 @@
1298 } 1400 }
1299 } 1401 }
1300 1402
1301-#include "liquid.moc" 1403-#include "liquid.moc"
1302+// #include "liquid.moc" 1404+// #include "liquid.moc"
1303 1405
1304 1406
1305 1407
1306 --- -Sat Sep 21 05:31:48 2002 1408 --- -2002-10-24 03:19:31.000000000 +0200
1307 +++ plugin.cppMon Jul 8 02:42:56 2002 1409 +++ plugin.cpp2002-10-04 03:37:38.000000000 +0200
1308@@ -1,29 +1,113 @@ 1410@@ -1,29 +1,84 @@
1411+#include <qapplication.h>
1412+
1309 #include "liquid.h" 1413 #include "liquid.h"
1310-#include <klocale.h> 1414-#include <klocale.h>
1311+#include "liquidset.h" 1415+#include "liquidset.h"
1312+#include "plugin.h" 1416+#include "plugin.h"
1313 1417+
1314-extern "C" {
1315- KStyle* allocate();
1316- int minor_version();
1317- int major_version();
1318- const char *description();
1319+ 1418+
1320+ 1419+
1321+LiquidInterface::LiquidInterface ( ) : ref ( 0 ) 1420+LiquidInterface::LiquidInterface ( ) : ref ( 0 )
1322+{ 1421+{
1422 +m_widget = 0;
1323+} 1423+}
1324+ 1424+
1325+LiquidInterface::~LiquidInterface ( ) 1425+LiquidInterface::~LiquidInterface ( )
1326+{ 1426+{
1327+} 1427+}
1328+ 1428+
1329+QStyle *LiquidInterface::create ( ) 1429+QStyle *LiquidInterface::style ( )
1330+{ 1430+{
1331 +return new LiquidStyle ( ); 1431 +return new LiquidStyle ( );
1332+} 1432+}
1333+ 1433+
1334+QString LiquidInterface::name ( ) 1434+QString LiquidInterface::name ( ) const
1435+{
1436 +return qApp-> translate ( "Styles", "Liquid" );
1437+}
1438+
1439+QString LiquidInterface::description ( ) const
1440+{
1441 +return qApp-> translate ( "Styles", "High Performance Liquid style by Mosfet" );
1442+}
1443+
1444+bool LiquidInterface::hasSettings ( ) const
1445+{
1446 +return true;
1447+}
1448+
1449+QWidget *LiquidInterface::create ( QWidget *parent, const char *name )
1335+{ 1450+{
1336 +return QObject::tr( "Liquid", "name" ); 1451 +m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" );
1452
1453-extern "C" {
1454- KStyle* allocate();
1455- int minor_version();
1456- int major_version();
1457- const char *description();
1458 +return m_widget;
1337 } 1459 }
1338 1460
1339-KStyle* allocate() 1461-KStyle* allocate()
1340+QString LiquidInterface::description ( ) 1462+bool LiquidInterface::accept ( )
1341 { 1463 {
1342- return(new LiquidStyle); 1464- return(new LiquidStyle);
1343 +return QObject::tr( "High Performance Liquid style by Mosfet", "description" ); 1465 +if ( !m_widget )
1466 + return false;
1467+
1468 +return m_widget-> writeConfig ( );
1344 } 1469 }
1345 1470
1346-int minor_version() 1471-int minor_version()
1347+QCString LiquidInterface::key ( ) 1472+void LiquidInterface::reject ( )
1348 { 1473 {
1349- return(0); 1474- return(0);
1350 +return QCString ( "liquid" );
1351 } 1475 }
1352 1476
1353-int major_version() 1477-int major_version()
1354+unsigned int LiquidInterface::version ( ) 1478+
1479+QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
1355 { 1480 {
1356- return(1); 1481- return(1);
1357 +return 100; // 1.0.0 (\d+.\d.\d)
1358 }
1359
1360-const char *description()
1361+QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
1362+{
1363 +static LiquidSettingsInterface *setiface = 0;
1364+
1365 +*iface = 0; 1482 +*iface = 0;
1366 + 1483 +
1367 +if ( uuid == IID_QUnknown ) 1484 +if ( uuid == IID_QUnknown )
1368 + *iface = this; 1485 + *iface = this;
1369 +else if ( uuid == IID_Style ) 1486 +else if ( uuid == IID_Style )
1370 + *iface = this; 1487 + *iface = this;
1371 +else if ( uuid == IID_StyleSettings ) { 1488 +else if ( uuid == IID_StyleExtended )
1372 + if ( !setiface ) 1489 + *iface = this;
1373 + setiface = new LiquidSettingsInterface ( );
1374 + *iface = setiface;
1375 +}
1376 + 1490 +
1377 +if ( *iface ) 1491 +if ( *iface )
1378 + (*iface)-> addRef ( ); 1492 + (*iface)-> addRef ( );
1379 + 1493 +
1380 +return QS_OK; 1494 +return QS_OK;
1381+} 1495 }
1382+ 1496
1497-const char *description()
1383+Q_EXPORT_INTERFACE() 1498+Q_EXPORT_INTERFACE()
1384+{
1385 +Q_CREATE_INSTANCE( LiquidInterface )
1386+}
1387+
1388+
1389+LiquidSettingsInterface::LiquidSettingsInterface ( ) : ref ( 0 )
1390 { 1499 {
1391- return(i18n("High performance liquid plugin").utf8()); 1500- return(i18n("High performance liquid plugin").utf8());
1392 +m_widget = 0; 1501 +Q_CREATE_INSTANCE( LiquidInterface )
1393 } 1502 }
1394+
1395+LiquidSettingsInterface::~LiquidSettingsInterface ( )
1396+{
1397+}
1398+
1399+QWidget *LiquidSettingsInterface::create ( QWidget *parent, const char *name )
1400+{
1401 +m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" );
1402 +
1403 +return m_widget;
1404+}
1405+
1406+bool LiquidSettingsInterface::accept ( )
1407+{
1408 +if ( !m_widget )
1409 + return false;
1410+ 1503+
1411 +return m_widget-> writeConfig ( );
1412+}
1413+ 1504+
1414+void LiquidSettingsInterface::reject ( ) 1505+
1415+{
1416+}
1417+
1418+QRESULT LiquidSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
1419+{
1420 +*iface = 0;
1421 +
1422 +
1423 +if ( uuid == IID_QUnknown )
1424 + *iface = this;
1425 +else if ( uuid == IID_StyleSettings )
1426 + *iface = this;
1427 +
1428 +if ( *iface )
1429 + (*iface)-> addRef ( );
1430 +
1431 +return QS_OK;
1432+}
1433+ 1506+
1434+// Hack for Retail Z experiments 1507+// Hack for Retail Z experiments
1435+extern "C" { QStyle *allocate ( ) { return new LiquidStyle ( ); } } 1508+extern "C" { QStyle *allocate ( ) { return new LiquidStyle ( ); } }