summaryrefslogtreecommitdiff
authorsandman <sandman>2002-10-24 01:21:24 (UTC)
committer sandman <sandman>2002-10-24 01:21:24 (UTC)
commitf09549e37fee6decd56168043209e8051b8757fb (patch) (unidiff)
treecfcfc40bfca40df380489829ab5b88cff91d1fee
parent36e13db0a1d44abd5a160a34e4679b90d62826c7 (diff)
downloadopie-f09549e37fee6decd56168043209e8051b8757fb.zip
opie-f09549e37fee6decd56168043209e8051b8757fb.tar.gz
opie-f09549e37fee6decd56168043209e8051b8757fb.tar.bz2
- "what's this" widget drop shadows are drawn correctly now
- updated the QPL diff
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
@@ -844,5 +844,7 @@ void LiquidStyle::polish(QWidget *w)
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 }
@@ -945,5 +947,7 @@ void LiquidStyle::unPolish(QWidget *w)
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 }
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
@@ -4,6 +4,6 @@ Features:
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
@@ -111,6 +111,6 @@ Features:
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
@@ -123,5 +123,5 @@ Features:
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>
@@ -147,8 +147,8 @@ Features:
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
@@ -230,5 +230,5 @@ Features:
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 }
@@ -240,16 +240,15 @@ Features:
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 }
@@ -286,11 +285,11 @@ Features:
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
@@ -301,7 +300,8 @@ Features:
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- }
@@ -324,9 +324,8 @@ Features:
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 }
@@ -344,5 +343,5 @@ Features:
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)
@@ -352,5 +351,5 @@ Features:
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
@@ -389,5 +388,5 @@ Features:
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
@@ -406,5 +405,5 @@ Features:
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);
@@ -431,5 +430,5 @@ Features:
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 }
@@ -457,5 +456,7 @@ Features:
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+ }
@@ -487,10 +488,7 @@ Features:
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") ||
@@ -501,5 +499,5 @@ Features:
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);
@@ -507,9 +505,10 @@ Features:
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);
@@ -520,4 +519,7 @@ Features:
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;
@@ -528,5 +530,5 @@ Features:
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 }
@@ -536,5 +538,8 @@ Features:
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 }
@@ -543,14 +548,21 @@ Features:
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+ }
@@ -558,5 +570,5 @@ Features:
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));
@@ -567,5 +579,5 @@ Features:
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);
@@ -586,5 +598,5 @@ Features:
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 }
@@ -598,5 +610,5 @@ Features:
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 {
@@ -634,6 +646,70 @@ Features:
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)
@@ -644,5 +720,5 @@ Features:
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 }
@@ -681,5 +757,5 @@ Features:
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 }
@@ -703,5 +779,31 @@ Features:
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
@@ -715,5 +817,5 @@ Features:
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());
@@ -724,5 +826,5 @@ Features:
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){
@@ -733,5 +835,5 @@ Features:
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{
@@ -742,5 +844,5 @@ Features:
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 }
@@ -757,5 +859,5 @@ Features:
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;
@@ -768,5 +870,5 @@ Features:
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 }
@@ -779,5 +881,5 @@ Features:
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 }
@@ -790,5 +892,5 @@ Features:
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 }
@@ -801,5 +903,5 @@ Features:
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
@@ -823,5 +925,5 @@ Features:
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 }
@@ -845,5 +947,5 @@ Features:
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);
@@ -862,5 +964,7 @@ Features:
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()){
@@ -886,10 +990,8 @@ Features:
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-}
@@ -1039,5 +1141,5 @@ Features:
1039 } 1141 }
1040 else 1142 else
1041@@ -2300,8 +2055,8 @@ 1143@@ -2300,8 +2145,8 @@
1042 } 1144 }
1043 1145
@@ -1050,5 +1152,5 @@ Features:
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 );
@@ -1059,5 +1161,5 @@ Features:
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 }
@@ -1068,5 +1170,5 @@ Features:
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 }
@@ -1094,5 +1196,5 @@ Features:
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 }
@@ -1124,5 +1226,5 @@ Features:
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 }
@@ -1133,5 +1235,5 @@ Features:
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 }
@@ -1142,5 +1244,5 @@ Features:
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 }
@@ -1248,5 +1350,5 @@ Features:
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();
@@ -1278,5 +1380,5 @@ Features:
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()){
@@ -1287,5 +1389,5 @@ Features:
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();
@@ -1295,5 +1397,5 @@ Features:
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 }
@@ -1304,21 +1406,19 @@ Features:
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+
@@ -1327,40 +1427,57 @@ Features:
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 +
@@ -1369,9 +1486,6 @@ Features:
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 )
@@ -1379,56 +1493,15 @@ Features:
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