re-added window mask when drawing non-oxygen shadows. This makes poorer corners, but better shadows (can't have everything at the same time right now)
svn path=/trunk/KDE/kdebase/workspace/; revision=1124748
This commit is contained in:
parent
0f6f610265
commit
f6d60a9524
4 changed files with 34 additions and 7 deletions
|
@ -265,15 +265,25 @@ namespace Oxygen
|
||||||
QRegion Client::calcMask( void ) const
|
QRegion Client::calcMask( void ) const
|
||||||
{
|
{
|
||||||
|
|
||||||
if( isMaximized() )
|
if( isMaximized() ) { return widget()->rect(); }
|
||||||
{ return widget()->rect(); }
|
|
||||||
|
|
||||||
QRect frame( widget()->rect().adjusted(
|
QRect frame( widget()->rect().adjusted(
|
||||||
layoutMetric( LM_OuterPaddingLeft ), layoutMetric( LM_OuterPaddingTop ),
|
layoutMetric( LM_OuterPaddingLeft ), layoutMetric( LM_OuterPaddingTop ),
|
||||||
-layoutMetric( LM_OuterPaddingRight ), -layoutMetric( LM_OuterPaddingBottom ) ) );
|
-layoutMetric( LM_OuterPaddingRight ), -layoutMetric( LM_OuterPaddingBottom ) ) );
|
||||||
|
|
||||||
if( configuration().frameBorder() == Configuration::BorderNone && !isShade() ) return helper().roundedMask( frame, 1, 1, 1, 0 );
|
if( configuration().frameBorder() == Configuration::BorderNone && !isShade() )
|
||||||
else return helper().roundedMask( frame );
|
{
|
||||||
|
|
||||||
|
return compositingActive() ?
|
||||||
|
helper().decoRoundedMask( frame, 1, 1, 1, 0 ):
|
||||||
|
helper().roundedMask( frame, 1, 1, 1, 0 );
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
return compositingActive() ?
|
||||||
|
helper().decoRoundedMask( frame ):
|
||||||
|
helper().roundedMask( frame );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1239,7 +1249,7 @@ namespace Oxygen
|
||||||
void Client::updateWindowShape()
|
void Client::updateWindowShape()
|
||||||
{
|
{
|
||||||
|
|
||||||
if(isMaximized() || compositingActive() ) clearMask();
|
if(isMaximized()) clearMask();
|
||||||
else setMask( calcMask() );
|
else setMask( calcMask() );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,4 +144,18 @@ namespace Oxygen
|
||||||
|
|
||||||
return *pixmap;
|
return *pixmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//_______________________________________________________________________
|
||||||
|
QRegion DecoHelper::decoRoundedMask( const QRect& r, int left, int right, int top, int bottom ) const
|
||||||
|
{
|
||||||
|
// get rect geometry
|
||||||
|
int x, y, w, h;
|
||||||
|
r.getRect(&x, &y, &w, &h);
|
||||||
|
|
||||||
|
QRegion mask(x + 3*left, y + 0*top, w-3*(left+right), h-0*(top+bottom));
|
||||||
|
mask += QRegion(x + 0*left, y + 3*top, w-0*(left+right), h-3*(top+bottom));
|
||||||
|
mask += QRegion(x + 1*left, y + 1*top, w-1*(left+right), h-1*(top+bottom));
|
||||||
|
|
||||||
|
return mask;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,8 @@ namespace Oxygen
|
||||||
virtual QPixmap windecoButtonGlow(const QColor &color, int size = 21);
|
virtual QPixmap windecoButtonGlow(const QColor &color, int size = 21);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
virtual QRegion decoRoundedMask( const QRect&, int left = 1, int right = 1, int top = 1, int bottom = 1 ) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,12 +234,13 @@ namespace Oxygen
|
||||||
{
|
{
|
||||||
|
|
||||||
// mid gradient
|
// mid gradient
|
||||||
const qreal gradientSize = qMin( shadowSize, (shadowSize+fixedSize)/2 );
|
const qreal gradientSize = qMin( shadowSize, (shadowSize+2*fixedSize)/3 );
|
||||||
const qreal hoffset = shadowConfiguration.horizontalOffset()*gradientSize/fixedSize;
|
const qreal hoffset = shadowConfiguration.horizontalOffset()*gradientSize/fixedSize;
|
||||||
const qreal voffset = shadowConfiguration.verticalOffset()*gradientSize/fixedSize;
|
const qreal voffset = shadowConfiguration.verticalOffset()*gradientSize/fixedSize;
|
||||||
|
|
||||||
const int nPoints = 7;
|
const int nPoints = 7;
|
||||||
const qreal x[7] = {0, 4.5, 5.5, 7.5, 8.5, 11.5, 14.5 };
|
const qreal x[7] = {0, 4.5, 5.5, 7.5, 8.5, 11.5, 14.5 };
|
||||||
|
//const qreal values[7] = {0.55, 0.25, 0.20, 0.1, 0.06, 0.015, 0 };
|
||||||
const qreal values[7] = {0.55, 0.25, 0.20, 0.1, 0.06, 0.015, 0 };
|
const qreal values[7] = {0.55, 0.25, 0.20, 0.1, 0.06, 0.015, 0 };
|
||||||
QRadialGradient rg = QRadialGradient( size+8.0*hoffset, size+8.0*voffset, gradientSize );
|
QRadialGradient rg = QRadialGradient( size+8.0*hoffset, size+8.0*voffset, gradientSize );
|
||||||
QColor c = shadowConfiguration.midColor();
|
QColor c = shadowConfiguration.midColor();
|
||||||
|
|
Loading…
Reference in a new issue