made shadow cache mode configurable
svn path=/trunk/KDE/kdebase/workspace/; revision=1114942
This commit is contained in:
parent
99a0cddd77
commit
95c8da25e6
2 changed files with 37 additions and 1 deletions
|
@ -132,6 +132,10 @@ namespace Oxygen
|
|||
OxygenConfig::NARROW_BUTTON_SPACING,
|
||||
defaultConfiguration.useNarrowButtonSpacing() ) );
|
||||
|
||||
// shadow cache mode
|
||||
setShadowCacheMode( shadowCacheMode( group.readEntry(
|
||||
OxygenConfig::SHADOW_CACHE_MODE, defaultConfiguration.shadowCacheModeName( false ) ), false ) );
|
||||
|
||||
}
|
||||
|
||||
//__________________________________________________
|
||||
|
@ -154,6 +158,7 @@ namespace Oxygen
|
|||
group.writeEntry( OxygenConfig::ANIMATIONS_DURATION, animationsDuration() );
|
||||
group.writeEntry( OxygenConfig::TABS_ENABLED, tabsEnabled() );
|
||||
group.writeEntry( OxygenConfig::NARROW_BUTTON_SPACING, useNarrowButtonSpacing() );
|
||||
group.writeEntry( OxygenConfig::SHADOW_CACHE_MODE, shadowCacheModeName( false ) );
|
||||
|
||||
}
|
||||
|
||||
|
@ -329,4 +334,29 @@ namespace Oxygen
|
|||
|
||||
}
|
||||
|
||||
//__________________________________________________
|
||||
QString OxygenConfiguration::shadowCacheModeName( ShadowCacheMode value, bool translated )
|
||||
{
|
||||
QString out;
|
||||
switch( value )
|
||||
{
|
||||
case CacheDisabled: out = translated ? i18n( "Disabled" ):"Disabled"; break;
|
||||
case CacheVariable: out = translated ? i18n( "Variable" ):"Variable"; break;
|
||||
case CacheMaximum: out = translated ? i18n( "Maximum" ):"Maximum"; break;
|
||||
default: return OxygenConfiguration().shadowCacheModeName( translated );
|
||||
}
|
||||
|
||||
return out;
|
||||
|
||||
}
|
||||
|
||||
//__________________________________________________
|
||||
OxygenConfiguration::ShadowCacheMode OxygenConfiguration::shadowCacheMode( QString value, bool translated )
|
||||
{
|
||||
if( value == shadowCacheModeName( CacheDisabled, translated ) ) return CacheDisabled;
|
||||
else if( value == shadowCacheModeName( CacheVariable, translated ) ) return CacheVariable;
|
||||
else if( value == shadowCacheModeName( CacheMaximum, translated ) ) return CacheMaximum;
|
||||
else return OxygenConfiguration().shadowCacheMode();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace OxygenConfig
|
|||
static const QString ANIMATIONS_DURATION = "AnimationsDuration";
|
||||
static const QString TABS_ENABLED = "TabsEnabled";
|
||||
static const QString NARROW_BUTTON_SPACING = "UseNarrowButtonSpacing";
|
||||
|
||||
static const QString SHADOW_CACHE_MODE = "ShadowCacheMode";
|
||||
}
|
||||
|
||||
namespace Oxygen
|
||||
|
@ -173,6 +173,12 @@ namespace Oxygen
|
|||
//!@name cache mode
|
||||
//@{
|
||||
|
||||
static QString shadowCacheModeName( ShadowCacheMode, bool translated );
|
||||
static ShadowCacheMode shadowCacheMode( QString, bool translated );
|
||||
|
||||
QString shadowCacheModeName( bool translated ) const
|
||||
{ return shadowCacheModeName( shadowCacheMode(), translated ); }
|
||||
|
||||
void setShadowCacheMode( ShadowCacheMode mode )
|
||||
{ shadowCacheMode_ = mode; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue