From da8593d092ff6f1c3664ee8adfc26a6f2d32dd4a Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Tue, 11 May 2010 02:06:20 +0000 Subject: [PATCH] Improved glow, using analytical formula and number of points on gradient adjusted to gradient size. svn path=/trunk/KDE/kdebase/workspace/; revision=1125246 --- clients/oxygen/oxygenshadowcache.cpp | 42 +++++++++++++++++++++------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/clients/oxygen/oxygenshadowcache.cpp b/clients/oxygen/oxygenshadowcache.cpp index 126aa42f84..487efa4fbd 100644 --- a/clients/oxygen/oxygenshadowcache.cpp +++ b/clients/oxygen/oxygenshadowcache.cpp @@ -183,13 +183,24 @@ namespace Oxygen const qreal hoffset = shadowConfiguration.horizontalOffset()*gradientSize/fixedSize; const qreal voffset = shadowConfiguration.verticalOffset()*gradientSize/fixedSize; - const int nPoints = 7; - const qreal x[7] = {0, 0.05, 0.1, 0.15, 0.2, 0.3, 0.4 }; - const qreal values[7] = {0.8, 0.78, 0.69, 0.42, 0.18, 0.01, 0 }; + // gaussian shadow is used + int nPoints( (10*gradientSize)/fixedSize ); + const qreal magnitude( 0.85 ); + const qreal width( 0.17 ); + QRadialGradient rg = QRadialGradient( size+12.0*hoffset, size+12.0*voffset, gradientSize ); + rg.setColorAt(1, Qt::transparent ); + QColor c = shadowConfiguration.innerColor(); - for( int i = 0; i