author | sandman <sandman> | 2002-12-08 23:12:16 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-12-08 23:12:16 (UTC) |
commit | 5f4bc1a6f31d713c97b8382b6e2acd12a7f9bfd6 (patch) (side-by-side diff) | |
tree | 52c1fcf139914d41b8dfb03fc4e954f95e5e7aef | |
parent | 7b38c0424eca2f49a0c9a931766c816e21f1d86b (diff) | |
download | opie-5f4bc1a6f31d713c97b8382b6e2acd12a7f9bfd6.zip opie-5f4bc1a6f31d713c97b8382b6e2acd12a7f9bfd6.tar.gz opie-5f4bc1a6f31d713c97b8382b6e2acd12a7f9bfd6.tar.bz2 |
removed some clumsy workarounds for old (unpatched) libqte's
-rw-r--r-- | noncore/styles/liquid/liquid.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp index 4a65952..bac882c 100644 --- a/noncore/styles/liquid/liquid.cpp +++ b/noncore/styles/liquid/liquid.cpp @@ -155,45 +155,39 @@ bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev) if ( !p->inherits("QPopupMenu")) p->setBackgroundMode(QWidget::PaletteBackground); QObjectList *ol = p-> queryList("QWidget"); for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { QWidget *wid = (QWidget *) it.current ( ); wid-> setBackgroundMode( QWidget::PaletteBackground ); } delete ol; } } return(false); } -static int qt_version ( ) -{ - const char *qver = qVersion ( ); - return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' ); -} LiquidStyle::LiquidStyle() :QWindowsStyle() { setName ( "LiquidStyle" ); - oldqte = ( qt_version ( ) < 234 ); flatTBButtons = false; currentHeader = 0; btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); btnMaskBmp.setMask(btnMaskBmp); htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); htmlBtnMaskBmp.setMask(htmlBtnMaskBmp); headerHoverID = -1; highlightWidget = NULL; setButtonDefaultIndicatorWidth(0); btnDict.setAutoDelete(true); bevelFillDict.setAutoDelete(true); smallBevelFillDict.setAutoDelete(true); rMatrix.rotate(270.0); btnBorderPix = new QPixmap; @@ -694,36 +688,34 @@ void LiquidStyle::polish(QPalette &appPal) btnBorderDict.clear(); bevelFillDict.clear(); smallBevelFillDict.clear(); Config config ( "qpe" ); config. setGroup ( "Liquid-Style" ); int contrast = config. readNumEntry ( "StippleContrast", 5 ); if ( contrast < 0 ) contrast = 0; else if ( contrast > 10 ) contrast = 10; // QPalette pal = QApplication::palette(); // button color stuff config. setGroup ( "Appearance" ); - QColor c = oldqte ? QColor ( config. readEntry("Button", ( Qt::lightGray ). name ( ))) - : appPal. color ( QPalette::Active, QColorGroup::Button ); - if ( c == ( oldqte ? QColor ( config. readEntry ( "background", ( Qt::lightGray ). name ( ))) - : appPal. color ( QPalette::Active, QColorGroup::Background ))) { + QColor c = appPal. color ( QPalette::Active, QColorGroup::Button ); + if ( c == appPal. color ( QPalette::Active, QColorGroup::Background )) { // force button color to be different from background QBrush btnBrush(QColor(200, 202, 228)); appPal.setBrush(QColorGroup::Button, btnBrush); } c.hsv(&btnH, &btnS, &btnV); c.light(120).hsv(&btnHoverH, &btnHoverS, &btnHoverV); // menu pixmap if(!menuPix){ menuPix = new QPixmap; menuPix->resize(64, 64); } QPainter painter; menuPix->fill(c.rgb()); painter.begin(menuPix); painter.setPen(c.dark(105)); @@ -748,34 +740,33 @@ void LiquidStyle::polish(QPalette &appPal) // pagerHoverBrush.setColor(c); // pagerHoverBrush.setPixmap(*pix); c = c.dark(120); pix = smallBevelFillDict.find(c.rgb()); // better be NULL ;-) if(!pix){ int h, s, v; c.hsv(&h, &s, &v); pix = new QPixmap(*smallBevelFillPix); adjustHSV(*pix, h, s, v); smallBevelFillDict.insert(c.rgb(), pix); } // pagerBrush.setColor(c); // pagerBrush.setPixmap(*pix); // background color stuff - c = oldqte ? QColor ( config. readEntry ( "Background", ( Qt::lightGray ).name ( ))) - : appPal. color ( QPalette::Active, QColorGroup::Background ); + c = appPal. color ( QPalette::Active, QColorGroup::Background ); c.hsv(&bH, &bS, &bV); c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV); // FIXME? if(vsbSliderFillPix) delete vsbSliderFillPix; vsbSliderFillPix = new QPixmap(bevelFillPix->xForm(rMatrix)); adjustHSV(*vsbSliderFillPix, bH, bS, bV); // background brush QPixmap wallPaper(32, 32); wallPaper.fill(c.rgb()); painter.begin(&wallPaper); for(i=0; i < 32; i+=4){ painter.setPen(c.dark(100 + contrast)); |