From 0f6f610265cafb0e9712013d0721186a7521a4ff Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Mon, 10 May 2010 00:28:38 +0000 Subject: [PATCH] Fixed decoration shadows and glow for large-size settings. svn path=/trunk/KDE/kdebase/workspace/; revision=1124726 --- clients/oxygen/oxygenshadowcache.cpp | 72 +++++++++++++++++----------- 1 file changed, 43 insertions(+), 29 deletions(-) diff --git a/clients/oxygen/oxygenshadowcache.cpp b/clients/oxygen/oxygenshadowcache.cpp index 94102c5bd7..8a6d2a33c5 100644 --- a/clients/oxygen/oxygenshadowcache.cpp +++ b/clients/oxygen/oxygenshadowcache.cpp @@ -162,12 +162,6 @@ namespace Oxygen p.setRenderHint( QPainter::Antialiasing ); p.setPen( Qt::NoPen ); - // offsets are scaled with the shadow size - // so that the ratio Top-shadow/Bottom-shadow is kept constant - // when shadow size is changed - qreal hoffset = shadowConfiguration.horizontalOffset()*shadowSize/fixedSize; - qreal voffset = shadowConfiguration.verticalOffset()*shadowSize/fixedSize; - // some gradients rendering are different at bottom corners if client has no border bool hasBorder( key.hasBorder || key.isShade ); @@ -179,30 +173,38 @@ namespace Oxygen { + const qreal gradientSize = qMin( shadowSize, (shadowSize+fixedSize)/2 ); + const qreal hoffset = shadowConfiguration.horizontalOffset()*gradientSize/fixedSize; + const qreal voffset = shadowConfiguration.verticalOffset()*gradientSize/fixedSize; + // inner (shark) gradient - int nPoints = 7; - qreal x[7] = {0, 0.05, 0.1, 0.15, 0.2, 0.3, 0.4 }; - int values[7] = {203, 200, 175, 105, 45, 2, 0 }; - QRadialGradient rg = QRadialGradient( size+12.0*hoffset, size+12.0*voffset, shadowSize ); + 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 }; + QRadialGradient rg = QRadialGradient( size+12.0*hoffset, size+12.0*voffset, gradientSize ); QColor c = shadowConfiguration.innerColor(); for( int i = 0; i