Implement and activate shadow effect settings relating to default shadow
overrides. svn path=/trunk/KDE/kdebase/workspace/; revision=888722
This commit is contained in:
parent
9dc6216729
commit
1a97abea6d
4 changed files with 15 additions and 7 deletions
|
@ -24,6 +24,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "options.h"
|
||||
#include "effects.h"
|
||||
|
||||
#include <kconfiggroup.h>
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
|
@ -216,7 +218,10 @@ bool Bridge::shadowsActive() const
|
|||
if( !c->workspace()->compositingActive() )
|
||||
return false;
|
||||
if( effects && static_cast<EffectsHandlerImpl*>( effects )->isEffectLoaded( "kwin4_effect_shadow" ))
|
||||
return true;
|
||||
{ // The shadow effect has a setting to disable decoration shadows, take it into account.
|
||||
KConfigGroup conf = static_cast<EffectsHandlerImpl*>( effects )->effectConfig( "Shadow" );
|
||||
return !conf.readEntry( "forceDecoratedToDefault", false );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,9 @@ void ShadowEffect::reconfigure( ReconfigureFlags )
|
|||
shadowSize = conf.readEntry( "Size", 5 );
|
||||
intensifyActiveShadow = conf.readEntry( "IntensifyActiveShadow", true );
|
||||
updateShadowColor();
|
||||
forceDecorated = conf.readEntry( "forceDecoratedToDefault", false );
|
||||
forceUndecorated = conf.readEntry( "forceUndecoratedToDefault", false );
|
||||
forceOther = conf.readEntry( "forceOtherToDefault", false );
|
||||
|
||||
// Load decoration shadow related things
|
||||
bool reconfiguring = false;
|
||||
|
@ -275,7 +278,7 @@ void ShadowEffect::buildQuads( EffectWindow* w, WindowQuadList& quadList )
|
|||
// active and inactive shadows. Is implementing it worth
|
||||
// the performance drop?
|
||||
int id = 0;
|
||||
if( w->hasDecoration() )
|
||||
if( w->hasDecoration() && !forceDecorated )
|
||||
{ // Decorated windows must be normal windows
|
||||
foreach( const QRect &r, w->shadowQuads( ShadowBorderedActive ))
|
||||
{
|
||||
|
@ -288,7 +291,7 @@ void ShadowEffect::buildQuads( EffectWindow* w, WindowQuadList& quadList )
|
|||
quadList.append( quad );
|
||||
}
|
||||
}
|
||||
else if( w->isNormalWindow() )
|
||||
else if( w->isNormalWindow() && !forceUndecorated )
|
||||
{ // No decoration on a normal window
|
||||
foreach( const QRect &r, w->shadowQuads( ShadowBorderlessActive ))
|
||||
{
|
||||
|
@ -301,7 +304,7 @@ void ShadowEffect::buildQuads( EffectWindow* w, WindowQuadList& quadList )
|
|||
quadList.append( quad );
|
||||
}
|
||||
}
|
||||
else
|
||||
else if( !forceOther )
|
||||
{ // All other undecorated windows
|
||||
foreach( const QRect &r, w->shadowQuads( ShadowOther ))
|
||||
{
|
||||
|
|
|
@ -69,6 +69,9 @@ class ShadowEffect
|
|||
int shadowSize;
|
||||
bool intensifyActiveShadow;
|
||||
QColor shadowColor;
|
||||
bool forceDecorated;
|
||||
bool forceUndecorated;
|
||||
bool forceOther;
|
||||
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
|
||||
QList< QList<GLTexture*> > mShadowTextures;
|
||||
QList<GLTexture*> mDefaultShadowTextures;
|
||||
|
|
|
@ -262,9 +262,6 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="title" >
|
||||
<string>Decoration Shadows</string>
|
||||
</property>
|
||||
|
|
Loading…
Reference in a new issue