-rw-r--r-- | noncore/styles/liquid/liquid.cpp | 8 | ||||
-rw-r--r-- | noncore/styles/liquid/opie-liquid.diff | 389 |
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 | |||
@@ -845,3 +845,5 @@ void LiquidStyle::polish(QWidget *w) | |||
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); |
@@ -946,3 +948,5 @@ void LiquidStyle::unPolish(QWidget *w) | |||
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); |
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 | |||
@@ -5,4 +5,4 @@ Features: | |||
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 @@ |
@@ -112,4 +112,4 @@ Features: | |||
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 @@ |
@@ -124,3 +124,3 @@ Features: | |||
124 | -#include <kpixmapeffect.h> | 124 | -#include <kpixmapeffect.h> |
125 | +#include "liquiddeco.h" | 125 | +//#include "liquiddeco.h" |
126 | +#include <qapplication.h> | 126 | +#include <qapplication.h> |
@@ -148,2 +148,3 @@ Features: | |||
148 | +#include <qmenubar.h> | 148 | +#include <qmenubar.h> |
149 | +#include <qprogressbar.h> | ||
149 | 150 | ||
@@ -151,3 +152,2 @@ Features: | |||
151 | -#include <X11/Xlib.h> | 152 | -#include <X11/Xlib.h> |
152 | + | ||
153 | +#include <stdio.h> | 153 | +#include <stdio.h> |
@@ -231,3 +231,3 @@ Features: | |||
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()); |
@@ -241,14 +241,13 @@ Features: | |||
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 | } |
@@ -287,3 +286,3 @@ Features: | |||
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); |
@@ -291,5 +290,5 @@ Features: | |||
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 | ||
@@ -302,5 +301,6 @@ Features: | |||
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 | } |
@@ -325,7 +325,6 @@ Features: | |||
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); |
@@ -345,3 +344,3 @@ Features: | |||
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 | ||
@@ -353,3 +352,3 @@ Features: | |||
353 | if(pixmaps[i]){ | 352 | if(pixmaps[i]){ |
354 | @@ -730,20 +703,29 @@ | 353 | @@ -730,20 +701,29 @@ |
355 | } | 354 | } |
@@ -390,3 +389,3 @@ Features: | |||
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); |
@@ -407,3 +406,3 @@ Features: | |||
407 | 406 | ||
408 | @@ -817,21 +791,18 @@ | 407 | @@ -817,21 +789,18 @@ |
409 | wallPaper.fill(c.rgb()); | 408 | wallPaper.fill(c.rgb()); |
@@ -432,3 +431,3 @@ Features: | |||
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); |
@@ -458,3 +457,5 @@ Features: | |||
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); |
@@ -488,8 +489,5 @@ Features: | |||
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") || |
@@ -502,3 +500,3 @@ Features: | |||
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); |
@@ -508,2 +506,3 @@ Features: | |||
508 | + w-> setBackgroundMode ( QWidget::PaletteBackground ); | 506 | + w-> setBackgroundMode ( QWidget::PaletteBackground ); |
507 | + w->setBackgroundOrigin ( QWidget::ParentOrigin); | ||
509 | + } | 508 | + } |
@@ -512,3 +511,3 @@ Features: | |||
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); |
@@ -521,2 +520,5 @@ Features: | |||
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")){ |
@@ -529,3 +531,3 @@ Features: | |||
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; |
@@ -537,3 +539,6 @@ Features: | |||
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 | } |
@@ -544,8 +549,13 @@ Features: | |||
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 | ||
@@ -553,3 +563,5 @@ Features: | |||
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); |
@@ -559,3 +571,3 @@ Features: | |||
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) || |
@@ -568,3 +580,3 @@ Features: | |||
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); |
@@ -587,3 +599,3 @@ Features: | |||
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); |
@@ -599,3 +611,3 @@ Features: | |||
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) |
@@ -635,4 +647,68 @@ Features: | |||
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 | */ |
@@ -645,3 +721,3 @@ Features: | |||
645 | QObjectListIt it(*tbChildList); | 721 | QObjectListIt it(*tbChildList); |
646 | @@ -1076,35 +1055,7 @@ | 722 | @@ -1076,35 +1128,7 @@ |
647 | 723 | ||
@@ -682,3 +758,3 @@ Features: | |||
682 | if(btn->isEnabled()){ | 758 | if(btn->isEnabled()){ |
683 | @@ -1119,20 +1070,7 @@ | 759 | @@ -1119,20 +1143,7 @@ |
684 | } | 760 | } |
@@ -704,3 +780,29 @@ Features: | |||
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(); |
@@ -716,3 +818,3 @@ Features: | |||
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()) |
@@ -725,3 +827,3 @@ Features: | |||
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; |
@@ -734,3 +836,3 @@ Features: | |||
734 | 13, 8); | 836 | 13, 8); |
735 | @@ -1690,7 +1623,7 @@ | 837 | @@ -1690,7 +1713,7 @@ |
736 | } | 838 | } |
@@ -743,3 +845,3 @@ Features: | |||
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); |
@@ -758,3 +860,3 @@ Features: | |||
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 |
@@ -769,3 +871,3 @@ Features: | |||
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)); |
@@ -780,3 +882,3 @@ Features: | |||
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)); |
@@ -791,3 +893,3 @@ Features: | |||
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 | } |
@@ -802,3 +904,3 @@ Features: | |||
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 | } |
@@ -824,3 +926,3 @@ Features: | |||
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); |
@@ -846,3 +948,3 @@ Features: | |||
846 | - | 948 | - |
847 | - | 949 | |
848 | - | 950 | - |
@@ -863,3 +965,5 @@ Features: | |||
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 && |
@@ -887,8 +991,6 @@ Features: | |||
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)); |
@@ -1040,3 +1142,3 @@ Features: | |||
1040 | else | 1142 | else |
1041 | @@ -2300,8 +2055,8 @@ | 1143 | @@ -2300,8 +2145,8 @@ |
1042 | } | 1144 | } |
@@ -1051,3 +1153,3 @@ Features: | |||
1051 | switch(menuHandler->transType()){ | 1153 | switch(menuHandler->transType()){ |
1052 | @@ -2336,8 +2091,6 @@ | 1154 | @@ -2336,8 +2181,6 @@ |
1053 | 1155 | ||
@@ -1060,3 +1162,3 @@ Features: | |||
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); |
@@ -1069,3 +1171,3 @@ Features: | |||
1069 | } | 1171 | } |
1070 | @@ -2508,25 +2261,6 @@ | 1172 | @@ -2508,25 +2351,6 @@ |
1071 | return h; | 1173 | return h; |
@@ -1095,3 +1197,3 @@ Features: | |||
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; |
@@ -1125,3 +1227,3 @@ Features: | |||
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 |
@@ -1134,3 +1236,3 @@ Features: | |||
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); |
@@ -1143,3 +1245,3 @@ Features: | |||
1143 | int x2 = x+w-1; | 1245 | int x2 = x+w-1; |
1144 | @@ -2726,105 +2460,6 @@ | 1246 | @@ -2726,105 +2550,6 @@ |
1145 | } | 1247 | } |
@@ -1249,3 +1351,3 @@ Features: | |||
1249 | { | 1351 | { |
1250 | @@ -2998,22 +2633,22 @@ | 1352 | @@ -2998,22 +2723,22 @@ |
1251 | customBtnIconList.clear(); | 1353 | customBtnIconList.clear(); |
@@ -1279,3 +1381,3 @@ Features: | |||
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); |
@@ -1288,3 +1390,3 @@ Features: | |||
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(); |
@@ -1296,3 +1398,3 @@ Features: | |||
1296 | void LiquidStyle::applyCustomAttributes(QPushButton *btn) | 1398 | void LiquidStyle::applyCustomAttributes(QPushButton *btn) |
1297 | @@ -3087,7 +2721,7 @@ | 1399 | @@ -3087,7 +2811,7 @@ |
1298 | } | 1400 | } |
@@ -1305,5 +1407,7 @@ Features: | |||
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" |
@@ -1312,8 +1416,3 @@ Features: | |||
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 | + |
@@ -1322,2 +1421,3 @@ Features: | |||
1322 | +{ | 1421 | +{ |
1422 | +m_widget = 0; | ||
1323 | +} | 1423 | +} |
@@ -1328,3 +1428,3 @@ Features: | |||
1328 | + | 1428 | + |
1329 | +QStyle *LiquidInterface::create ( ) | 1429 | +QStyle *LiquidInterface::style ( ) |
1330 | +{ | 1430 | +{ |
@@ -1333,5 +1433,27 @@ Features: | |||
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 | } |
@@ -1339,6 +1461,9 @@ Features: | |||
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 | } |
@@ -1346,6 +1471,5 @@ Features: | |||
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 | } |
@@ -1353,13 +1477,6 @@ Features: | |||
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; |
@@ -1370,7 +1487,4 @@ Features: | |||
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 | + |
@@ -1380,54 +1494,13 @@ Features: | |||
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 | + |