implemented extended border region for oxygen

This commit is contained in:
Hugo Pereira Da Costa 2012-11-07 13:40:06 +01:00
parent 98a68c3bfe
commit f4cdf47c93
2 changed files with 24 additions and 0 deletions

View file

@ -1428,6 +1428,27 @@ namespace Oxygen
{ painter.drawPixmap( QPoint(), _pixmap ); }
}
//_________________________________________________________
QRegion Client::region( KDecorationDefines::Region r )
{
if( r == KDecorationDefines::ExtendedBorderRegion && configuration().frameBorder() <= Configuration::BorderNoSide )
{
const QRect rect = widget()->rect().adjusted(
0, 0,
-layoutMetric( LM_OuterPaddingLeft ) - layoutMetric( LM_OuterPaddingRight ),
-layoutMetric( LM_OuterPaddingTop ) - layoutMetric( LM_OuterPaddingBottom ) );
// only return non-empty region on the sides for which there is no border
if( configuration().frameBorder() == Configuration::BorderNone ) return QRegion( rect.adjusted( -3, 0, 3, 3 ) ) - rect;
else return QRegion( rect.adjusted( -3, 0, 3, 0 ) ) - rect;
} else return QRegion();
}
//_________________________________________________________
void Client::paintEvent( QPaintEvent* event )
{

View file

@ -234,6 +234,9 @@ namespace Oxygen
void updateTitleRect( void )
{ widget()->update( titleRect().adjusted( 0, -layoutMetric( LM_TitleEdgeTop ), 0, 1 ) ); }
//! return region for a given defines. This allows to implement extended borders
QRegion region( KDecorationDefines::Region );
protected:
//! return shadow cache key associated to this client