--Boundary-00=_VvhJAnqfLceb4nd Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline hi i like the gnome/xp =A0semi-transparent rubberband better then the XOR one,= so i=20 added this to kde. the patch have 4 parts: qiconview.diff: patch for qt's iconview - since it's coded specificly for X= OR=20 style rubberbad, i had to change that to a double-buffer (the double-buffer= =20 is active only while the rubberband is active). the patch also disables the= =20 focus rect drawing. kstyle.diff: the actuall rubberband. color is taken from the text highlight= =20 background. kiconview.diff/kfileividesktop.diff: add round rect background to the text = of=20 selected icons (i think it looks better this way) in konqueror/kdesktop aviv (patches are against qt 3.3.0/kde 3.2rc1) --Boundary-00=_VvhJAnqfLceb4nd Content-Type: text/x-diff; charset="us-ascii"; name="qiconview.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="qiconview.diff" --- qt/src/iconview/qiconview.cpp 2004-02-07 22:31:30.000000000 +0200 +++ qt/src/iconview/qiconview.cpp 2004-02-07 23:45:59.000000000 +0200 @@ -261,6 +261,7 @@ QIconViewToolTip *toolTip; QPixmapCache maskCache; + QPixmap *backrubber; QPtrDict selectedItems; struct ItemContainer { @@ -2062,6 +2063,7 @@ void QIconViewItem::paintFocus( QPainter *p, const QColorGroup &cg ) { + return; if ( !view ) return; @@ -2778,6 +2780,7 @@ d->renamingItem = 0; d->drawActiveSelection = TRUE; d->drawDragShapes = FALSE; + d->backrubber = NULL; connect( d->adjustTimer, SIGNAL( timeout() ), this, SLOT( adjustItems() ) ); @@ -3324,30 +3327,28 @@ viewport()->setUpdatesEnabled( TRUE ); blockSignals( block ); - QRect r = *d->rubber; - *d->rubber = oldRubber; + ensureVisible( pos.x(), pos.y() ); - QPainter p; - p.begin( viewport() ); - p.setRasterOp( NotROP ); - p.setPen( QPen( color0, 1 ) ); - p.setBrush( NoBrush ); - drawRubber( &p ); + QRect all_r = oldRubber.normalize(); + if ( changed ) + all_r |= rr; + all_r |= *d->rubber; + QPoint p1 = contentsToViewport(all_r.topLeft()); + all_r = QRect(p1.x(),p1.y(),all_r.width(),all_r.height()); + all_r &= viewport()->rect(); + all_r.addCoords(-2,-2,2,2); d->dragging = FALSE; - p.end(); - - *d->rubber = r; - if ( changed ) { - d->drawAllBack = FALSE; - d->clipRegion = region; - repaintContents( rr, FALSE ); - d->drawAllBack = TRUE; + if (d->backrubber == 0) { + d->backrubber = new QPixmap(viewport()->rect().size()); + d->backrubber->fill(viewport(),viewport()->rect().topLeft()); } + QPainter p(d->backrubber); + p.save(); + p.translate(-contentsX(),-contentsY()); + drawContents(&p, contentsX()+all_r.left(), contentsY()+all_r.top(),all_r.width(), all_r.height() ); + p.restore(); - ensureVisible( pos.x(), pos.y() ); - - p.begin( viewport() ); p.setRasterOp( NotROP ); p.setPen( QPen( color0, 1 ) ); p.setBrush( NoBrush ); @@ -3353,9 +3354,10 @@ p.setBrush( NoBrush ); drawRubber( &p ); d->dragging = TRUE; - p.end(); + bitBlt( viewport(), all_r.topLeft(), d->backrubber, all_r ); + if ( changed ) { emit selectionChanged(); if ( d->selectionMode == Single ) @@ -3386,8 +3388,6 @@ void QIconView::drawContents( QPainter *p, int cx, int cy, int cw, int ch ) { - if ( d->dragging && d->rubber ) - drawRubber( p ); QRect r = QRect( cx, cy, cw, ch ); @@ -3461,9 +3461,6 @@ d->currentItem->rect().intersects( r ) ) { d->currentItem->paintFocus( p, colorGroup() ); } - - if ( d->dragging && d->rubber ) - drawRubber( p ); } /*! @@ -4364,15 +4361,13 @@ if ( d->rubber ) { QPainter p; p.begin( viewport() ); - p.setRasterOp( NotROP ); - p.setPen( QPen( color0, 1 ) ); - p.setBrush( NoBrush ); - - drawRubber( &p ); + repaintContents(d->rubber->normalize(),FALSE); d->dragging = FALSE; p.end(); delete d->rubber; d->rubber = 0; + delete d->backrubber; + d->backrubber = 0; if ( d->scrollTimer ) { disconnect( d->scrollTimer, SIGNAL( timeout() ), this, SLOT( doAutoScroll() ) ); @@ -4559,11 +4554,7 @@ if ( d->rubber ) { QPainter p; p.begin( viewport() ); - p.setRasterOp( NotROP ); - p.setPen( QPen( color0, 1 ) ); - p.setBrush( NoBrush ); - - drawRubber( &p ); + repaintContents(d->rubber->normalize(),FALSE); d->dragging = FALSE; p.end(); @@ -4572,6 +4563,8 @@ emitClicked = FALSE; delete d->rubber; d->rubber = 0; + delete d->backrubber; + d->backrubber = 0; d->currentItem = d->tmpCurrentItem; d->tmpCurrentItem = 0; if ( d->currentItem ) --Boundary-00=_VvhJAnqfLceb4nd Content-Type: text/x-diff; charset="us-ascii"; name="kfileividesktop.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kfileividesktop.diff" --- kdebase/kdesktop/kfileividesktop.cpp 2004-02-07 23:55:58.000000000 +0200 +++ kdebase/kdesktop/kfileividesktop.cpp 2004-02-08 00:06:39.000000000 +0200 @@ -81,6 +81,11 @@ // draw the pixmap as in KIconViewItem::paintItem(...) paintPixmap(p, colors); + if (isSelected()) { + p->setBrush(QBrush(cg.highlight())); + p->setPen(QPen(cg.highlight())); + p->drawRoundRect( textRect( false ) ,1000/textRect(false).width(),1000/textRect(false).height() ); + } // // Paint the text as shadowed if the shadow is available // --Boundary-00=_VvhJAnqfLceb4nd Content-Type: text/x-diff; charset="us-ascii"; name="kstyle.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kstyle.diff" --- kdelibs/kdefx/kstyle.cpp 2004-02-07 23:53:39.000000000 +0200 +++ kdelibs/kdefx/kstyle.cpp 2004-02-07 23:59:18.000000000 +0200 @@ -550,7 +550,24 @@ else // General handle, probably a kicker applet handle. drawKStylePrimitive( KPE_GeneralHandle, p, widget, r, cg, flags, opt ); +#ifdef HAVE_XRENDER + } else if (pe == PE_RubberBand) { + + XRenderColor clr = {cg.highlight().red()*255,cg.highlight().green()*255,cg.highlight().blue()*255,0x7000}; + QRect r2 = r.normalize(); + QPoint zp(0,0); + zp = p->xForm(zp); + XRenderFillRectangle(p->device()->x11Display(),PictOpOver,p->device()->x11RenderHandle(), + &clr,r2.x()+zp.x(),r2.y()+zp.y(),r2.width(),r2.height()); + + r2.addCoords(1,1,0,0); + p->setRasterOp(Qt::CopyROP); + p->setPen(QPen(cg.highlight(),2)); + p->setBrush(NoBrush); + p->drawRect(r2); + +#endif } else QCommonStyle::drawPrimitive( pe, p, r, cg, flags, opt ); } --Boundary-00=_VvhJAnqfLceb4nd Content-Type: text/x-diff; charset="us-ascii"; name="kiconview.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kiconview.diff" --- kdelibs/kdeui/kiconview.cpp 2004-02-07 23:54:35.000000000 +0200 +++ kdelibs/kdeui/kiconview.cpp 2004-02-08 00:04:17.000000000 +0200 @@ -593,7 +593,9 @@ int textY = textRect( false ).y(); if ( isSelected() ) { - p->fillRect( textRect( false ), cg.highlight() ); + p->setBrush(QBrush(cg.highlight())); + p->setPen(QPen(cg.highlight())); + p->drawRoundRect( textRect( false ) ,1000/textRect(false).width(),1000/textRect(false).height() ); p->setPen( QPen( cg.highlightedText() ) ); } else { if ( iconView()->itemTextBackground() != NoBrush ) --Boundary-00=_VvhJAnqfLceb4nd Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --Boundary-00=_VvhJAnqfLceb4nd--