From 2385ed545b3bf558b690e9158d4a92fe70bb45cb Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Thu, 27 Nov 2008 14:25:59 +0000 Subject: [PATCH] Make parts of the shadow texture that are under windows transparent. Fixes translucent windows graphical glitch. svn path=/trunk/KDE/kdebase/workspace/; revision=889744 --- clients/oxygen/oxygen.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/clients/oxygen/oxygen.cpp b/clients/oxygen/oxygen.cpp index efe533c846..d095623ca8 100644 --- a/clients/oxygen/oxygen.cpp +++ b/clients/oxygen/oxygen.cpp @@ -193,6 +193,7 @@ QList< QList > OxygenFactory::shadowTextures() shadow->fill( Qt::transparent ); QRadialGradient rg( size, size, size ); QColor c = color; + c.setAlpha( 0 ); rg.setColorAt( 4/size, c ); c.setAlpha( 255 ); rg.setColorAt( 4.4/size, c ); c = glow; c.setAlpha( 220 ); rg.setColorAt( 4.5/size, c ); @@ -207,6 +208,7 @@ QList< QList > OxygenFactory::shadowTextures() rg = QRadialGradient( size, size, size ); c = color; + c.setAlpha( 0 ); rg.setColorAt( 4/size, c ); c.setAlpha( 255 ); rg.setColorAt( 4.4/size, c ); c = glow2; c.setAlpha( 0.58*255 ); rg.setColorAt( 4.5/size, c ); @@ -319,6 +321,12 @@ QList< QList > OxygenFactory::shadowTextures() p.setPen(QPen(lg, 0.8)); p.drawEllipse(QRectF(size-4, size-4, 8, 8)); + // cut out the part of the texture that is under the window + p.setCompositionMode( QPainter::CompositionMode_Xor ); + p.setBrush( QColor( 0, 0, 0, 255 )); + p.setPen( Qt::NoPen ); + p.drawEllipse(QRectF(size-4, size-4, 8, 8)); + p.end(); MAKE_TEX( w, h, 0, h+1 ); // corner