Commit 8d221488 authored by Hugo Pereira Da Costa's avatar Hugo Pereira Da Costa
Browse files

added "roundCorner" to shadows passed to kwin. This allows to use mask for...

added "roundCorner" to shadows passed to kwin. This allows to use mask for detached dockwidgets, and still have nice
bevelled corners.
CCBUG: 273848
parent 3f26cbc8
......@@ -27,6 +27,7 @@
#include "oxygenshadowhelper.h"
#include "oxygenshadowhelper.moc"
#include "oxygenshadowcache.h"
#include "oxygenstylehelper.h"
#include <KConfig>
......@@ -51,8 +52,9 @@ namespace Oxygen
const char* const ShadowHelper::netWMSkipShadowPropertyName( "_KDE_NET_WM_SKIP_SHADOW" );
//_____________________________________________________
ShadowHelper::ShadowHelper( QObject* parent, Helper& helper ):
ShadowHelper::ShadowHelper( QObject* parent, StyleHelper& helper ):
QObject( parent ),
_helper( helper ),
_shadowCache( new ShadowCache( helper ) ),
_size( 0 )
#ifdef Q_WS_X11
......@@ -140,12 +142,19 @@ namespace Oxygen
// retrieve shadow pixmap
_size = shadowCache().shadowSize();
// add transparency
QPixmap pixmap( shadowCache().pixmap( ShadowCache::Key() ) );
{
QPainter painter( &pixmap );
// add transparency
painter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
painter.fillRect( pixmap.rect(), QColor( 0, 0, 0, 150 ) );
// add round corners
const QRect cornerRect( (pixmap.width()-10)/2, (pixmap.height()-10)/2, 10, 10 );
painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
_helper.roundCorner( QPalette().color( QPalette::Window ) )->render( cornerRect, &painter );
}
// recreate tileset
......
......@@ -42,7 +42,7 @@ namespace Oxygen
//! forward declaration
class ShadowCache;
class Helper;
class StyleHelper;
//! handle shadow pixmaps passed to window manager via X property
class ShadowHelper: public QObject
......@@ -58,7 +58,7 @@ namespace Oxygen
static const char* const netWMSkipShadowPropertyName;
//! constructor
ShadowHelper( QObject*, Helper& );
ShadowHelper( QObject*, StyleHelper& );
//! destructor
virtual ~ShadowHelper( void );
......@@ -123,6 +123,9 @@ namespace Oxygen
private:
//! helper
StyleHelper& _helper;
//! cache
ShadowCache* _shadowCache;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment