author | sandman <sandman> | 2002-10-24 01:21:24 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-24 01:21:24 (UTC) |
commit | f09549e37fee6decd56168043209e8051b8757fb (patch) (side-by-side diff) | |
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 @@ -842,9 +842,11 @@ void LiquidStyle::polish(QWidget *w) return; } if(w->inherits("QPopupMenu")) w->setBackgroundMode(QWidget::NoBackground); - else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { + else if(w-> testWFlags(Qt::WType_Popup) && + !w->inherits("QListBox") && + ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) { w->installEventFilter(menuHandler); } if(w->isTopLevel()){ @@ -943,9 +945,11 @@ void LiquidStyle::unPolish(QWidget *w) } if(w->inherits("QPopupMenu")) w->setBackgroundMode(QWidget::PaletteButton); - else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { + else if(w-> testWFlags(Qt::WType_Popup) && + !w->inherits("QListBox") && + ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) { w->removeEventFilter(menuHandler); } if(w->isTopLevel()) 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 @@ -2,10 +2,10 @@ This is a patch to mosfet's liquid 0.7. Features: - Qt-only - works with Qt/E on QPE/OPIE ---- - Sat Sep 21 05:31:47 2002 -+++ liquid.h Mon Jul 15 02:52:50 2002 +--- - 2002-10-24 03:19:30.000000000 +0200 ++++ liquid.h 2002-07-15 02:52:50.000000000 +0200 @@ -2,7 +2,7 @@ #define LIQUID_STYLE_H @@ -109,10 +109,10 @@ Features: + bool flatTBButtons; bool highcolor; QColorGroup radioOnGrp; QWidget *highlightWidget; ---- - Sat Sep 21 05:31:48 2002 -+++ liquid.cpp Sat Sep 21 05:18:54 2002 +--- - 2002-10-24 03:19:31.000000000 +0200 ++++ liquid.cpp 2002-10-24 03:18:15.000000000 +0200 @@ -10,12 +10,10 @@ #include <qmenudata.h> #include "liquid.h" @@ -121,9 +121,9 @@ Features: -#include <kconfig.h> -#include <kdrawutil.h> -#include <kglobalsettings.h> -#include <kpixmapeffect.h> -+#include "liquiddeco.h" ++//#include "liquiddeco.h" +#include <qapplication.h> +#include <qpe/config.h> +#include "effects.h" #include <qpalette.h> @@ -145,12 +145,12 @@ Features: -#include <kiconloader.h> -#include <kmenubar.h> -#include <kipc.h> +#include <qmenubar.h> ++#include <qprogressbar.h> -#include <X11/X.h> -#include <X11/Xlib.h> -+ +#include <stdio.h> #include "htmlmasks.h" #include "embeddata.h" @@ -228,9 +228,9 @@ Features: + *pix = QPixmap::grabWindow(QApplication::desktop()-> winId(), r.x(), r.y(), r.width(), r.height()); } else{ // tear off menu -@@ -121,82 +122,55 @@ +@@ -121,82 +122,53 @@ stripePixmap(*pix, p->colorGroup().button()); } else{ - KPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color); @@ -238,20 +238,19 @@ Features: } + pixDict.insert(p->winId(), pix); + -+ if (!p->inherits("QPopupMenu")) { ++ if ( !p->inherits("QPopupMenu")) + p->setBackgroundPixmap(*pix); + -+ QObjectList *ol = p-> queryList("QWidget"); -+ for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { -+ QWidget *wid = (QWidget *) it.current ( ); ++ QObjectList *ol = p-> queryList("QWidget"); ++ for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { ++ QWidget *wid = (QWidget *) it.current ( ); + -+ wid-> setBackgroundPixmap(*pix); -+ wid-> setBackgroundOrigin(QWidget::ParentOrigin); -+ } -+ delete ol; -+ } ++ wid-> setBackgroundPixmap(*pix); ++ wid-> setBackgroundOrigin(QWidget::ParentOrigin); ++ } ++ delete ol; } } else if(ev->type() == QEvent::Hide){ if(type == TransStippleBg || type == TransStippleBtn || @@ -284,26 +283,27 @@ Features: - w->close(); - } - } + pixDict.remove(p->winId()); -+ if (!p->inherits("QPopupMenu")) { ++ if ( !p->inherits("QPopupMenu")) + p->setBackgroundMode(QWidget::PaletteBackground); - reloadSettings(); -+ QObjectList *ol = p-> queryList("QWidget"); -+ for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { -+ QWidget *wid = (QWidget *) it.current ( ); ++ QObjectList *ol = p-> queryList("QWidget"); ++ for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { ++ QWidget *wid = (QWidget *) it.current ( ); - // Now repaint menubar if needed - if(shadowText != oldShadow){ - it.toFirst(); - while ((w=it.current()) != 0 ){ - ++it; - if(w->inherits("QMenuBar")){ - w->repaint(); -- } -- } -+ wid-> setBackgroundMode( QWidget::PaletteBackground ); ++ wid-> setBackgroundMode( QWidget::PaletteBackground ); + } ++ delete ol; + } } - } - else if(id == MOSFET_BUTTON_CHANGE){ - qWarning("In mosfet button change"); @@ -322,13 +322,12 @@ Features: - while ((w=it.current()) != 0 ){ - ++it; - if(w->inherits("QPushButton")){ - ((LiquidStyle*)parent())->applyCustomAttributes((QPushButton *)w); -+ delete ol; - } - } +- } +- } - - } +- } + return(false); } + @@ -342,17 +341,17 @@ Features: + btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); btnMaskBmp.setMask(btnMaskBmp); htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); -@@ -711,7 +685,6 @@ +@@ -711,7 +683,6 @@ void LiquidStyle::polish(QPalette &appPal) { - int i; for(i=0; i < BITMAP_ITEMS; ++i){ if(pixmaps[i]){ -@@ -730,20 +703,29 @@ +@@ -730,20 +701,29 @@ } loadCustomButtons(); - lowLightVal = 100 + (2*KGlobalSettings::contrast()+4)*10; @@ -387,9 +386,9 @@ Features: + ) { // force button color to be different from background QBrush btnBrush(QColor(200, 202, 228)); appPal.setBrush(QColorGroup::Button, btnBrush); -@@ -794,15 +776,7 @@ +@@ -794,15 +774,7 @@ pagerBrush.setPixmap(*pix); // background color stuff - c = config->readColorEntry("background", &Qt::lightGray); @@ -404,9 +403,9 @@ Features: + c = /*QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( )));*/ appPal. color ( QPalette::Active, QColorGroup::Background ); c.hsv(&bH, &bS, &bV); c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV); -@@ -817,21 +791,18 @@ +@@ -817,21 +789,18 @@ wallPaper.fill(c.rgb()); painter.begin(&wallPaper); for(i=0; i < 32; i+=4){ - painter.setPen(c.dark(105)); @@ -429,9 +428,9 @@ Features: + c = /*QColor ( config. readEntry("Base", ( Qt::white). name ( )));*/ appPal. color ( QPalette::Active, QColorGroup::Base ); QPixmap basePix; basePix.resize(32, 32); basePix.fill(c.rgb()); -@@ -856,52 +827,39 @@ +@@ -856,52 +825,37 @@ applyCustomAttributes((QPushButton *)w); } } - @@ -455,9 +454,11 @@ Features: return; } if(w->inherits("QPopupMenu")) w->setBackgroundMode(QWidget::NoBackground); -+ else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { ++ else if(w-> testWFlags(Qt::WType_Popup) && ++ !w->inherits("QListBox") && ++ ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) { + w->installEventFilter(menuHandler); + } if(w->isTopLevel()){ @@ -485,89 +486,100 @@ Features: - if(qstrcmp(kapp->argv()[0], "kicker") == 0 && - w->inherits("KPanelExtension")){ // FIXME - doesn't work - w->setPalette(kapp->palette()); - } -+ -+ -+ if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame )) -+ w-> setBackgroundOrigin ( QWidget::ParentOrigin ); - if(w->inherits("QComboBox") || +- if(w->inherits("QComboBox") || ++ if(w->inherits("QComboBox") || w->inherits("QProgressBar") || w->inherits("QLineEdit") || w->inherits("QRadioButton") || - w->inherits("QCheckBox") || w->inherits("QScrollBar") || - w->isA("AppletHandle") || w->inherits("KMiniPagerButton") || - w->inherits("TaskContainer")){ + w->inherits("QCheckBox") || w->inherits("QScrollBar")) { w->installEventFilter(this); } if(w->inherits("QLineEdit")){ -@@ -913,6 +871,9 @@ +@@ -913,6 +867,10 @@ applyCustomAttributes((QPushButton *)w); w->installEventFilter(this); } + if(w->inherits("QButton") || w-> inherits("QComboBox")){ + w-> setBackgroundMode ( QWidget::PaletteBackground ); ++ w->setBackgroundOrigin ( QWidget::ParentOrigin); + } bool isViewport = qstrcmp(w->name(), "qt_viewport") == 0 || qstrcmp(w->name(), "qt_clipped_viewport") == 0; -@@ -942,11 +903,14 @@ +@@ -942,11 +900,17 @@ w->setMouseTracking(true); w->installEventFilter(this); } + if(w-> inherits("QToolButton")&&w->parent()->inherits("QToolBar")) { + ((QToolButton*)w)->setAutoRaise (flatTBButtons); + if ( flatTBButtons ) + w->setBackgroundOrigin(QWidget::ParentOrigin); + } ++ if(w-> inherits("QToolBarSeparator")&&w->parent()->inherits("QToolBar")) { ++ ((QFrame *) w)-> setFrameShape ( QFrame::NoFrame ); ++ } if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){ return; } - if(w->inherits("PanelButtonBase")) - return; if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())-> palette().active().brush(QColorGroup::Background).pixmap()){ -@@ -954,17 +918,13 @@ +@@ -954,16 +918,21 @@ return; } if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) && - !w->inherits("KDesktop") && !w->inherits("PasswordDlg")){ + !( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) { if(w->backgroundMode() == QWidget::PaletteBackground || w->backgroundMode() == QWidget::PaletteButton){ - w->setBackgroundMode(QWidget::X11ParentRelative); +- w->setBackgroundMode(QWidget::X11ParentRelative); ++ w->setBackgroundMode(w->parentWidget()->backgroundMode( )/*QWidget::X11ParentRelative*/); ++ w->setBackgroundOrigin(QWidget::ParentOrigin); ++// w->setBackgroundMode(QWidget::NoBackground); } } - if(w->inherits("KToolBar")){ - w->installEventFilter(this); - //w->setBackgroundMode(QWidget::NoBackground); - return; -- } ++ if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame )) ++ w-> setBackgroundOrigin ( QWidget::ParentOrigin ); ++ else if ( w-> inherits("QFrame") ) ++ w->setBackgroundOrigin ( QWidget::WidgetOrigin ); + ++ if ( w->parentWidget()->inherits ( "QWidgetStack" )) { ++ w->setBackgroundOrigin ( QWidget::WidgetOrigin ); + } } - void LiquidStyle::unPolish(QWidget *w) -@@ -977,6 +937,9 @@ +@@ -977,6 +946,11 @@ if(w->inherits("QPopupMenu")) w->setBackgroundMode(QWidget::PaletteButton); -+ else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { ++ else if(w-> testWFlags(Qt::WType_Popup) && ++ !w->inherits("QListBox") && ++ ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) { + w->removeEventFilter(menuHandler); + } if(w->isTopLevel()) return; -@@ -986,7 +949,7 @@ +@@ -986,7 +960,7 @@ ((qstrcmp(w->parent()->name(), "qt_viewport") == 0) || (qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0)); - w->setPalette(QApplication::palette()); + w->unsetPalette(); if(w->backgroundMode() == QWidget::X11ParentRelative || isViewportChild){ if(w->inherits("QPushButton")) w->setBackgroundMode(QWidget::PaletteButton); -@@ -1001,12 +964,14 @@ +@@ -1001,12 +975,14 @@ unapplyCustomAttributes((QPushButton *)w); w->removeEventFilter(this); } - @@ -584,9 +596,9 @@ Features: + w->inherits("QCheckBox") || w->inherits("QScrollBar")) { w->removeEventFilter(this); } if(w->inherits("QButton") || w->inherits("QComboBox")){ -@@ -1014,9 +979,9 @@ +@@ -1014,9 +990,9 @@ w->setAutoMask(false); } } - if(w->inherits("KToolBar")){ @@ -596,9 +608,9 @@ Features: + w->setBackgroundMode(QWidget::PaletteBackground); return; } if(w->inherits("QHeader")){ -@@ -1028,20 +993,34 @@ +@@ -1028,22 +1004,98 @@ void LiquidStyle::polish(QApplication *app) { - KStyle::polish(app); @@ -632,19 +644,83 @@ Features: + +// QApplication::qwsSetDecoration ( new QPEDecoration ( )); } ++ ++/* !! HACK !! Beware ++ * ++ * TT forgot to make the QProgressBar widget styleable in Qt 2.x ++ * So the only way to customize the drawing, is to intercept the ++ * paint event - since we have to use protected functions, we need ++ * to derive a "hack" class from QProgressBar and do the painting ++ * in there. ++ * ++ * - sandman ++ */ ++ ++class HackProgressBar : public QProgressBar { ++public: ++ HackProgressBar ( ); ++ ++ void paint ( QPaintEvent *event, const QColorGroup &g, QPixmap *pix ) ++ { ++ QPainter p( this ); ++ ++ if ( !contentsRect().contains( event->rect() ) ) { ++ p.save(); ++ p.setClipRegion( event->region().intersect(frameRect()) ); ++ drawFrame( &p); ++ p.restore(); ++ } ++ if ( event->rect().intersects( contentsRect() )) { ++ p.setClipRegion( event->region().intersect( contentsRect() ) ); ++ ++ int x, y, w, h; ++ contentsRect ( ). rect ( &x, &y, &w, &h ); ++ ++ int prog = progress ( ); ++ int total = totalSteps ( ); ++ if ( prog < 0 ) ++ prog = 0; ++ if ( total <= 0 ) ++ total = 1; ++ int bw = w * prog / total; ++ if ( bw > w ) ++ bw = w; ++ ++ p.setPen(g.button().dark(130)); ++ p.drawRect(x, y, bw, h); ++ p.setPen(g.button().light(120)); ++ p.drawRect(x+1, y+1, bw-2, h-2); ++ ++ if(bw >= 4 && h >= 4 && pix) ++ p.drawTiledPixmap(x+2, y+2, bw-4, h-4, *pix); ++ ++ if ( progress ( )>= 0 && totalSteps ( ) > 0 ) { ++ QString pstr; ++ pstr. sprintf ( "%d%%", 100 * progress()/totalSteps ()); ++ p. setPen ( g.text());//g.highlightedText ( )); ++ p. drawText (x,y,w-1,h-1,AlignCenter,pstr); ++ } ++ } ++ } ++}; ++ ++ ++ /* -@@ -1063,7 +1042,7 @@ + * This is a fun method ;-) Here's an overview. KToolBar grabs resize to + * force everything to erase and repaint on resize. This is going away, I'm +@@ -1063,7 +1115,7 @@ */ bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) { - if(obj->inherits("KToolBar")){ + if(obj->inherits("QToolBar")){ if(ev->type() == QEvent::Resize){ const QObjectList *tbChildList = obj->children(); QObjectListIt it(*tbChildList); -@@ -1076,35 +1055,7 @@ +@@ -1076,35 +1128,7 @@ } } - else if(obj->inherits("KMiniPagerButton")){ @@ -679,9 +755,9 @@ Features: + else if(obj->inherits("QPushButton") || obj->inherits("QComboBox")){ QWidget *btn = (QWidget *)obj; if(ev->type() == QEvent::Enter){ if(btn->isEnabled()){ -@@ -1119,20 +1070,7 @@ +@@ -1119,20 +1143,7 @@ } } } - else if(obj->inherits("TaskContainer")){ @@ -701,9 +777,35 @@ Features: + else if(obj->inherits("QToolButton")){ QToolButton *btn = (QToolButton *)btn; if(!btn->autoRaise()){ if(btn->isEnabled()){ -@@ -1340,11 +1278,6 @@ +@@ -1290,7 +1301,24 @@ + } + } + } +- return(false); ++ else if (obj-> inherits( "QProgressBar" )) { ++ if ( ev->type() == QEvent::Paint ) { ++ HackProgressBar *p = (HackProgressBar *) obj; ++ const QColorGroup &g = p-> colorGroup ( ); ++ ++ QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb()); ++ if(!pix){ ++ int h, s, v; ++ g.button().dark(120).hsv(&h, &s, &v); ++ pix = new QPixmap(*bevelFillPix); ++ adjustHSV(*pix, h, s, v); ++ bevelFillDict.insert(g.button().dark(120).rgb(), pix); ++ } ++ p-> paint ((QPaintEvent *) ev, g, pix ); ++ return true; ++ } ++ } ++ return false ; + } + + void LiquidStyle::drawButton(QPainter *p, int x, int y, int w, int h, +@@ -1340,11 +1368,6 @@ QColorGroup g = btn->colorGroup(); - QColor testColor; @@ -713,36 +815,36 @@ Features: - //int dw = buttonDefaultIndicatorWidth(); if(btn->hasFocus() || btn->isDefault()){ QColor c = btn->hasFocus() ? g.button().light(110) : g.background(); -@@ -1596,7 +1529,7 @@ +@@ -1596,7 +1619,7 @@ if(sbBuffer.size() != sb->size()) sbBuffer.resize(sb->size()); } - subB.setRect( subX,subY,buttonDim,buttonDim ); + subB.setRect( subX,subY,0,0); // buttonDim,buttonDim ); addB.setRect( addX,addY,buttonDim,buttonDim ); if(horiz) subHC.setRect(addX-buttonDim,addY,buttonDim,buttonDim ); -@@ -1624,7 +1557,7 @@ +@@ -1624,7 +1647,7 @@ QPainter painter; if(!horiz){ painter.begin(&sbBuffer); - QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*3))+1); + QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*2))+1); if(sliderR.height() >= 8){ painter.drawPixmap(bgR.x()+1, bgR.y(), *vsbSliderFillPix, 0, 0, 13, 8); -@@ -1690,7 +1623,7 @@ +@@ -1690,7 +1713,7 @@ } else{ painter.begin(&sbBuffer); - QRect bgR(subB.right()+1, 0, (len-(buttonDim*3))+1, sb->height()); + QRect bgR(subB.right()+1, 0, (len-(buttonDim*2))+1, sb->height()); if(sliderR.width() >= 8){ painter.drawPixmap(bgR.x(), bgR.y()+1, *vsbSliderFillPix, 0, 0, 8, 13); -@@ -1761,10 +1694,10 @@ +@@ -1761,10 +1784,10 @@ addB.width()-8, addB.height()-8, g, !maxed); } if ( controls & SubLine ) { - drawSBButton(p, subB, g, activeControl == SubLine); @@ -755,9 +857,9 @@ Features: + // subB.width()-8, subB.height()-8, g, !maxed); drawSBButton(p, subHC, g, activeControl == SubLine); drawArrow( p, horiz ? LeftArrow : UpArrow, false, subHC.x()+4, subHC.y()+4, -@@ -1865,8 +1798,8 @@ +@@ -1865,8 +1888,8 @@ else buttonDim = ( length - b*2 )/2 - 1; - sliderMin = b + buttonDim; @@ -766,9 +868,9 @@ Features: + maxLength = length - b*2 - buttonDim*2; // 3; if ( sb->maxValue() == sb->minValue() ) { sliderLength = maxLength; -@@ -1914,8 +1847,8 @@ +@@ -1914,8 +1937,8 @@ return(QSize(16, 16)); } -void LiquidStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int w, @@ -777,9 +879,9 @@ Features: + int /*h*/, const QColorGroup &/*g*/, bool on, bool down, bool) { bool isHover = highlightWidget == p->device(); -@@ -1957,8 +1890,8 @@ +@@ -1957,8 +1980,8 @@ return(QSize(20, 22)); } -void LiquidStyle::drawIndicator(QPainter *p, int x, int y, int w, int h, @@ -788,9 +890,9 @@ Features: + const QColorGroup &/*g*/, int state, bool /*down*/, bool) { bool isHover = highlightWidget == p->device(); bool isMasked = p->device() && p->device()->devType() == QInternal::Widget -@@ -1996,8 +1929,8 @@ +@@ -1996,8 +2019,8 @@ } } -void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int w, int h, @@ -799,9 +901,9 @@ Features: + int /*state*/) { // needed for some reason by KHtml, even tho it's all filled ;P p->drawPixmap(x, y, *getPixmap(HTMLCB)->mask()); -@@ -2005,18 +1938,17 @@ +@@ -2005,18 +2028,17 @@ } void LiquidStyle::drawSlider(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, Orientation orient, @@ -821,9 +923,9 @@ Features: +void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, Orientation orient, bool, bool) { p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() : -@@ -2065,203 +1997,26 @@ +@@ -2065,203 +2087,26 @@ p->drawLineSegments(a); } -void LiquidStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h, @@ -843,9 +945,9 @@ Features: - p->drawPoint(x2, y); - p->drawPoint(x, y2); - p->drawPoint(x2, y2); - -- + - - // p->drawRect(x, y, w, h); - QPixmap *pix = bevelFillDict.find(g.button().rgb()); - if(!pix){ @@ -860,9 +962,11 @@ Features: -} - -void LiquidStyle::drawKMenuBar(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool mac, QBrush *) --{ ++void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, ++ QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active ) + { - if(p->device() && p->device()->devType() == QInternal::Widget && - ((KMenuBar *)p->device())->isTopLevelMenu()){ - p->setPen(Qt::black); - p->drawRect(x, y, w, h); @@ -884,14 +988,12 @@ Features: - &g.brush(QColorGroup::Background)); - } - -} - +- -void LiquidStyle::drawKToolBar(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, KToolBarPos, QBrush *) -+void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, -+ QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active ) - { +-{ - //p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); -} - -void LiquidStyle::drawKToolBarButton(QPainter *p, int x, int y, int w, int h, @@ -1037,9 +1139,9 @@ Features: + shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : g.background().dark(130); } else -@@ -2300,8 +2055,8 @@ +@@ -2300,8 +2145,8 @@ } void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, int lineWidth, @@ -1048,27 +1150,27 @@ Features: + const QBrush * /*fill*/) { QColor c; switch(menuHandler->transType()){ -@@ -2336,8 +2091,6 @@ +@@ -2336,8 +2181,6 @@ maxpmw = QMAX( maxpmw, 20 ); - if ( p->font() == KGlobalSettings::generalFont() ) - p->setFont( KGlobalSettings::menuFont() ); bool dis = !enabled; QColorGroup itemg = dis ? pal.disabled() : pal.active(); -@@ -2363,7 +2116,7 @@ +@@ -2363,7 +2206,7 @@ p->fillRect(x, y, w, h, menuBrush); } else{ - KPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); + QPixmap *pix = menuHandler->pixmap(((QWidget*)p->device())->winId()); if(pix) p->drawPixmap(x, y, *pix, x, y, w, h); } -@@ -2508,25 +2261,6 @@ +@@ -2508,25 +2351,6 @@ return h; } -void LiquidStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h, @@ -1092,9 +1194,9 @@ Features: -} void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r, const QColorGroup &g, const QColor *c, -@@ -2540,25 +2274,25 @@ +@@ -2540,25 +2364,25 @@ return; } else{ - KStyle::drawFocusRect(p, r, g, c, atBorder); @@ -1122,27 +1224,27 @@ Features: + QWindowsStyle::drawTab(p, tabBar, tab, selected); return; } QPixmap tilePix; -@@ -2671,7 +2405,7 @@ +@@ -2671,7 +2495,7 @@ vFrame = 8; // was 10 } else - KStyle::tabbarMetrics(t, hFrame, vFrame, overlap); + QWindowsStyle::tabbarMetrics(t, hFrame, vFrame, overlap); } -@@ -2699,7 +2433,7 @@ +@@ -2699,7 +2523,7 @@ p->drawLine(x+1, y+1, x+1, y2-1); } else if(lineWidth != 2 || !sunken) - KStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); + QWindowsStyle::drawPanel(p, x, y, w, h, g, sunken, lineWidth, fill); else{ QPen oldPen = p->pen(); int x2 = x+w-1; -@@ -2726,105 +2460,6 @@ +@@ -2726,105 +2550,6 @@ } } -void LiquidStyle::drawKickerAppletHandle(QPainter *p, int x, int y, int w, int h, @@ -1246,9 +1348,9 @@ Features: -} void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v) { -@@ -2998,22 +2633,22 @@ +@@ -2998,22 +2723,22 @@ customBtnIconList.clear(); customBtnLabelList.clear(); - KConfig *config = KGlobal::config(); @@ -1276,160 +1378,131 @@ Features: +// KIconLoader *ldr = KGlobal::iconLoader(); while(labelStr != NULL){ QColor *c = new QColor; c->setNamedColor(QString(colorStr)); -@@ -3022,7 +2657,7 @@ +@@ -3022,7 +2747,7 @@ QString tmpStr(iconStr); if(!tmpStr.isEmpty()){ QPixmap *pixmap = - new QPixmap(ldr->loadIcon(tmpStr, KIcon::Small)); + new QPixmap();//ldr->loadIcon(tmpStr, KIcon::Small)); if(pixmap->isNull()){ delete pixmap; customBtnIconList.append(NULL); -@@ -3037,7 +2672,6 @@ +@@ -3037,7 +2762,6 @@ colorStr = colorList.next(); iconStr = iconList.next(); } - config->setGroup(oldGrp); } void LiquidStyle::applyCustomAttributes(QPushButton *btn) -@@ -3087,7 +2721,7 @@ +@@ -3087,7 +2811,7 @@ } } -#include "liquid.moc" +// #include "liquid.moc" ---- - Sat Sep 21 05:31:48 2002 -+++ plugin.cpp Mon Jul 8 02:42:56 2002 -@@ -1,29 +1,113 @@ +--- - 2002-10-24 03:19:31.000000000 +0200 ++++ plugin.cpp 2002-10-04 03:37:38.000000000 +0200 +@@ -1,29 +1,84 @@ ++#include <qapplication.h> ++ #include "liquid.h" -#include <klocale.h> +#include "liquidset.h" +#include "plugin.h" - --extern "C" { -- KStyle* allocate(); -- int minor_version(); -- int major_version(); -- const char *description(); ++ + + +LiquidInterface::LiquidInterface ( ) : ref ( 0 ) +{ ++ m_widget = 0; +} + +LiquidInterface::~LiquidInterface ( ) +{ +} + -+QStyle *LiquidInterface::create ( ) ++QStyle *LiquidInterface::style ( ) +{ + return new LiquidStyle ( ); +} + -+QString LiquidInterface::name ( ) ++QString LiquidInterface::name ( ) const ++{ ++ return qApp-> translate ( "Styles", "Liquid" ); ++} ++ ++QString LiquidInterface::description ( ) const ++{ ++ return qApp-> translate ( "Styles", "High Performance Liquid style by Mosfet" ); ++} ++ ++bool LiquidInterface::hasSettings ( ) const ++{ ++ return true; ++} ++ ++QWidget *LiquidInterface::create ( QWidget *parent, const char *name ) +{ -+ return QObject::tr( "Liquid", "name" ); ++ m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" ); + +-extern "C" { +- KStyle* allocate(); +- int minor_version(); +- int major_version(); +- const char *description(); ++ return m_widget; } -KStyle* allocate() -+QString LiquidInterface::description ( ) ++bool LiquidInterface::accept ( ) { - return(new LiquidStyle); -+ return QObject::tr( "High Performance Liquid style by Mosfet", "description" ); ++ if ( !m_widget ) ++ return false; ++ ++ return m_widget-> writeConfig ( ); } -int minor_version() -+QCString LiquidInterface::key ( ) ++void LiquidInterface::reject ( ) { - return(0); -+ return QCString ( "liquid" ); } -int major_version() -+unsigned int LiquidInterface::version ( ) ++ ++QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) { - return(1); -+ return 100; // 1.0.0 (\d+.\d.\d) - } - --const char *description() -+QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) -+{ -+ static LiquidSettingsInterface *setiface = 0; -+ + *iface = 0; + + if ( uuid == IID_QUnknown ) + *iface = this; + else if ( uuid == IID_Style ) + *iface = this; -+ else if ( uuid == IID_StyleSettings ) { -+ if ( !setiface ) -+ setiface = new LiquidSettingsInterface ( ); -+ *iface = setiface; -+ } ++ else if ( uuid == IID_StyleExtended ) ++ *iface = this; + + if ( *iface ) + (*iface)-> addRef ( ); + + return QS_OK; -+} -+ + } + +-const char *description() +Q_EXPORT_INTERFACE() -+{ -+ Q_CREATE_INSTANCE( LiquidInterface ) -+} -+ -+ -+LiquidSettingsInterface::LiquidSettingsInterface ( ) : ref ( 0 ) { - return(i18n("High performance liquid plugin").utf8()); -+ m_widget = 0; ++ Q_CREATE_INSTANCE( LiquidInterface ) } -+ -+LiquidSettingsInterface::~LiquidSettingsInterface ( ) -+{ -+} -+ -+QWidget *LiquidSettingsInterface::create ( QWidget *parent, const char *name ) -+{ -+ m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" ); -+ -+ return m_widget; -+} -+ -+bool LiquidSettingsInterface::accept ( ) -+{ -+ if ( !m_widget ) -+ return false; + -+ return m_widget-> writeConfig ( ); -+} + -+void LiquidSettingsInterface::reject ( ) -+{ -+} -+ -+QRESULT LiquidSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) -+{ -+ *iface = 0; -+ -+ -+ if ( uuid == IID_QUnknown ) -+ *iface = this; -+ else if ( uuid == IID_StyleSettings ) -+ *iface = this; -+ -+ if ( *iface ) -+ (*iface)-> addRef ( ); -+ -+ return QS_OK; -+} ++ + +// Hack for Retail Z experiments +extern "C" { QStyle *allocate ( ) { return new LiquidStyle ( ); } } |