diff --git a/clients/oxygen/oxygenshadowcache.cpp b/clients/oxygen/oxygenshadowcache.cpp index c75fb32868..126aa42f84 100644 --- a/clients/oxygen/oxygenshadowcache.cpp +++ b/clients/oxygen/oxygenshadowcache.cpp @@ -29,6 +29,7 @@ #include "oxygenhelper.h" #include +#include #include #include #include @@ -36,6 +37,10 @@ namespace Oxygen { + //_______________________________________________________ + qreal sqr( qreal x ) + { return x*x; } + //_______________________________________________________ ShadowCache::ShadowCache( DecoHelper& helper ): helper_( helper ), @@ -173,11 +178,11 @@ namespace Oxygen { + // inner (shark) gradient 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 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 }; @@ -193,11 +198,11 @@ namespace Oxygen { + // outer (spread) gradient const qreal gradientSize = shadowSize; const qreal hoffset = shadowConfiguration.horizontalOffset()*gradientSize/fixedSize; const qreal voffset = shadowConfiguration.verticalOffset()*gradientSize/fixedSize; - // outer (spread) gradient const int nPoints = 7; const qreal x[7] = {0, 0.15, 0.3, 0.45, 0.65, 0.75, 1 }; const qreal values[7] = {0.47, 0.37, 0.2, 0.08, 0.04, 0.02, 0 }; @@ -214,19 +219,32 @@ namespace Oxygen } else { { + // inner (sharp gradient) const qreal gradientSize = qMin( shadowSize, fixedSize ); const qreal hoffset = shadowConfiguration.horizontalOffset()*gradientSize/fixedSize; const qreal voffset = shadowConfiguration.verticalOffset()*gradientSize/fixedSize; - // inner (sharp gradient) - const int nPoints = 5; - const qreal x[5] = { 0, 4.5, 5.0, 5.5, 6.5 }; - const qreal values[5] = { 1.0, 0.32, 0.22, 0.03, 0 }; - QRadialGradient rg = QRadialGradient( size+hoffset, size+voffset, gradientSize ); - QColor c = shadowConfiguration.innerColor(); - for( int i = 0; i