diff --git a/kstyle/breezehelper.h b/kstyle/breezehelper.h index 9640965b..cdc224bd 100644 --- a/kstyle/breezehelper.h +++ b/kstyle/breezehelper.h @@ -314,15 +314,15 @@ namespace Breeze //@} + //* frame radius + qreal frameRadius( qreal bias = 0 ) const + { return qMax( qreal( Metrics::Frame_FrameRadius ) - 0.5 + bias, 0.0 ); } + protected: //* initialize void init( void ); - //* frame radius - qreal frameRadius( qreal bias = 0 ) const - { return qMax( qreal( Metrics::Frame_FrameRadius ) - 0.5 + bias, 0.0 ); } - //* return rectangle for widgets shadow, offset depending on light source QRectF shadowRect( const QRectF& ) const; diff --git a/kstyle/breezeshadowhelper.cpp b/kstyle/breezeshadowhelper.cpp index 2fa1d01b..138581fa 100644 --- a/kstyle/breezeshadowhelper.cpp +++ b/kstyle/breezeshadowhelper.cpp @@ -153,6 +153,8 @@ namespace Breeze // metrics const int shadowSize = StyleConfigData::shadowSize()*12/16; + const int shadowOffset = qMax( shadowSize/2, Metrics::Shadow_Overlap*2 ); + // const int size( shadowSize - Metrics::Shadow_Overlap ); const int shadowStrength = StyleConfigData::shadowStrength(); // pixmap @@ -181,8 +183,21 @@ namespace Breeze // fill QPainter p(&pixmap); + p.setRenderHint( QPainter::Antialiasing, true ); p.setCompositionMode(QPainter::CompositionMode_Source); p.fillRect( pixmap.rect(), radialGradient); + + p.setPen( Qt::NoPen ); + p.setBrush( Qt::black ); + + QRectF innerRect( + shadowSize - shadowOffset - Metrics::Shadow_Overlap, shadowSize - shadowOffset - Metrics::Shadow_Overlap, + shadowOffset + 2*Metrics::Shadow_Overlap,shadowOffset + 2*Metrics::Shadow_Overlap ); + + p.setCompositionMode(QPainter::CompositionMode_DestinationOut ); + + const qreal radius( _helper.frameRadius() ); + p.drawRoundedRect( innerRect, radius, radius ); p.end(); // create tiles from pixmap