author | sandman <sandman> | 2002-10-24 01:21:24 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-24 01:21:24 (UTC) |
commit | f09549e37fee6decd56168043209e8051b8757fb (patch) (unidiff) | |
tree | cfcfc40bfca40df380489829ab5b88cff91d1fee | |
parent | 36e13db0a1d44abd5a160a34e4679b90d62826c7 (diff) | |
download | opie-f09549e37fee6decd56168043209e8051b8757fb.zip opie-f09549e37fee6decd56168043209e8051b8757fb.tar.gz opie-f09549e37fee6decd56168043209e8051b8757fb.tar.bz2 |
- "what's this" widget drop shadows are drawn correctly now
- updated the QPL diff
-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 | |||
@@ -843,7 +843,9 @@ void LiquidStyle::polish(QWidget *w) | |||
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 | ||
@@ -944,7 +946,9 @@ void LiquidStyle::unPolish(QWidget *w) | |||
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 | ||
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 | |||
@@ -3,8 +3,8 @@ Features: | |||
3 | - Qt-only | 3 | - Qt-only |
4 | - works with Qt/E on QPE/OPIE | 4 | - works with Qt/E on QPE/OPIE |
5 | 5 | ||
6 | --- -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 | ||
@@ -110,8 +110,8 @@ Features: | |||
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> |
@@ -122,7 +122,7 @@ Features: | |||
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" |
@@ -146,10 +146,10 @@ Features: | |||
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" |
@@ -229,7 +229,7 @@ Features: | |||
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{ |
@@ -239,18 +239,17 @@ Features: | |||
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){ |
@@ -285,13 +284,13 @@ Features: | |||
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){ |
@@ -300,9 +299,10 @@ Features: | |||
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){ |
@@ -323,11 +323,10 @@ Features: | |||
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 | ||
@@ -343,7 +342,7 @@ Features: | |||
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 | { |
@@ -351,7 +350,7 @@ Features: | |||
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(); |
@@ -388,7 +387,7 @@ Features: | |||
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 |
@@ -405,7 +404,7 @@ Features: | |||
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){ |
@@ -430,7 +429,7 @@ Features: | |||
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 | } |
@@ -456,7 +455,9 @@ Features: | |||
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 | ||
@@ -486,12 +487,9 @@ Features: | |||
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") || |
@@ -500,17 +498,18 @@ Features: | |||
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 | } |
@@ -519,6 +518,9 @@ Features: | |||
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 | } |
@@ -527,7 +529,7 @@ Features: | |||
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) && |
@@ -535,29 +537,39 @@ Features: | |||
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 | ||
@@ -566,7 +578,7 @@ Features: | |||
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 | } |
@@ -585,7 +597,7 @@ Features: | |||
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 | } |
@@ -597,7 +609,7 @@ Features: | |||
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 | ||
@@ -633,8 +645,72 @@ Features: | |||
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 | { |
@@ -643,7 +719,7 @@ Features: | |||
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 | } |
@@ -680,7 +756,7 @@ Features: | |||
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 | } |
@@ -702,7 +778,33 @@ Features: | |||
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 | ||
@@ -714,7 +816,7 @@ Features: | |||
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 | } |
@@ -723,7 +825,7 @@ Features: | |||
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); |
@@ -732,7 +834,7 @@ Features: | |||
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); |
@@ -741,7 +843,7 @@ Features: | |||
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 ) { |
@@ -756,7 +858,7 @@ Features: | |||
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 | ||
@@ -767,7 +869,7 @@ Features: | |||
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 | ||
@@ -778,7 +880,7 @@ Features: | |||
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 | ||
@@ -789,7 +891,7 @@ Features: | |||
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 | ||
@@ -800,7 +902,7 @@ Features: | |||
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, |
@@ -822,7 +924,7 @@ Features: | |||
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 | ||
@@ -844,7 +946,7 @@ Features: | |||
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()); |
@@ -861,7 +963,9 @@ Features: | |||
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); |
@@ -885,12 +989,10 @@ Features: | |||
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 | - |
@@ -1038,7 +1140,7 @@ Features: | |||
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, |
@@ -1049,7 +1151,7 @@ Features: | |||
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 | ||
@@ -1058,7 +1160,7 @@ Features: | |||
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{ |
@@ -1067,7 +1169,7 @@ Features: | |||
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 | ||
@@ -1093,7 +1195,7 @@ Features: | |||
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{ |
@@ -1123,7 +1225,7 @@ Features: | |||
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 |
@@ -1132,7 +1234,7 @@ Features: | |||
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) |
@@ -1141,7 +1243,7 @@ Features: | |||
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 | ||
@@ -1247,7 +1349,7 @@ Features: | |||
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 | ||
@@ -1277,7 +1379,7 @@ Features: | |||
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 = |
@@ -1286,7 +1388,7 @@ Features: | |||
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 | } |
@@ -1294,7 +1396,7 @@ Features: | |||
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 | ||
@@ -1303,133 +1405,104 @@ Features: | |||
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 ( ); } } |