Added checkbox to disable shadow drawing (as a replacement to setting shadow size to zero), consistently with the checkbox used to
disable the active window glow. svn path=/trunk/KDE/kdebase/workspace/; revision=1107183
This commit is contained in:
parent
f0e2ceab7d
commit
49411bcda5
10 changed files with 49 additions and 4 deletions
|
@ -128,6 +128,7 @@ namespace Oxygen
|
|||
|
||||
configurationGroup.writeEntry( OxygenConfig::DRAW_SEPARATOR, userInterface_->ui.drawSeparator->isChecked() );
|
||||
configurationGroup.writeEntry( OxygenConfig::DRAW_TITLE_OUTLINE, userInterface_->ui.titleOutline->isChecked() );
|
||||
configurationGroup.writeEntry( OxygenConfig::USE_DROP_SHADOWS, userInterface_->shadowConfigurations[1]->isChecked() );
|
||||
configurationGroup.writeEntry( OxygenConfig::USE_OXYGEN_SHADOWS, userInterface_->shadowConfigurations[0]->isChecked() );
|
||||
configurationGroup.writeEntry( OxygenConfig::TABS_ENABLED, userInterface_->ui.tabsEnabled->isChecked() );
|
||||
configurationGroup.writeEntry( OxygenConfig::USE_ANIMATIONS, userInterface_->ui.useAnimations->isChecked() );
|
||||
|
@ -193,6 +194,7 @@ namespace Oxygen
|
|||
userInterface_->ui.drawSeparator->setChecked( configuration.drawSeparator() );
|
||||
userInterface_->ui.titleOutline->setChecked( configuration.drawTitleOutline() );
|
||||
userInterface_->shadowConfigurations[0]->setChecked( configuration.useOxygenShadows() );
|
||||
userInterface_->shadowConfigurations[1]->setChecked( configuration.useDropShadows() );
|
||||
userInterface_->ui.tabsEnabled->setChecked( configuration.tabsEnabled() );
|
||||
userInterface_->ui.useAnimations->setChecked( configuration.useAnimations() );
|
||||
}
|
||||
|
|
|
@ -101,7 +101,10 @@ namespace Oxygen
|
|||
|
||||
connect( shadowConfigurations[0], SIGNAL( changed() ), SIGNAL( changed() ) );
|
||||
connect( shadowConfigurations[0], SIGNAL( toggled( bool ) ), SIGNAL( changed() ) );
|
||||
|
||||
connect( shadowConfigurations[1], SIGNAL( changed() ), SIGNAL( changed() ) );
|
||||
connect( shadowConfigurations[1], SIGNAL( toggled( bool ) ), SIGNAL( changed() ) );
|
||||
|
||||
connect( ui.titleAlignment, SIGNAL(currentIndexChanged(int)), SIGNAL( changed() ) );
|
||||
connect( ui.buttonSize, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) );
|
||||
connect( ui.frameBorder, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) );
|
||||
|
|
|
@ -191,6 +191,9 @@
|
|||
<property name="title">
|
||||
<string>Window Drop-Down Shadow</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
|
|
|
@ -127,6 +127,7 @@ namespace Oxygen
|
|||
|
||||
// read shadow configurations
|
||||
OxygenShadowConfiguration inactiveShadowConfiguration( QPalette::Inactive, config.group( "InactiveShadow" ) );
|
||||
inactiveShadowConfiguration.setEnabled( configuration.useDropShadows() );
|
||||
if( shadowCache().shadowConfigurationChanged( inactiveShadowConfiguration ) )
|
||||
{
|
||||
shadowCache().setShadowConfiguration( inactiveShadowConfiguration );
|
||||
|
|
|
@ -40,6 +40,7 @@ namespace Oxygen
|
|||
drawSeparator_( false ),
|
||||
drawTitleOutline_( false ),
|
||||
hideTitleBar_( false ),
|
||||
useDropShadows_( true ),
|
||||
useOxygenShadows_( true ),
|
||||
useAnimations_( true ),
|
||||
animateTitleChange_( true ),
|
||||
|
@ -95,6 +96,11 @@ namespace Oxygen
|
|||
OxygenConfig::HIDE_TITLEBAR,
|
||||
defaultConfiguration.hideTitleBar() ) );
|
||||
|
||||
// drop shadows
|
||||
setUseDropShadows( group.readEntry(
|
||||
OxygenConfig::USE_DROP_SHADOWS,
|
||||
defaultConfiguration.useDropShadows() ) );
|
||||
|
||||
// oxygen shadows
|
||||
setUseOxygenShadows( group.readEntry(
|
||||
OxygenConfig::USE_OXYGEN_SHADOWS,
|
||||
|
@ -140,6 +146,7 @@ namespace Oxygen
|
|||
group.writeEntry( OxygenConfig::DRAW_SEPARATOR, drawSeparator() );
|
||||
group.writeEntry( OxygenConfig::DRAW_TITLE_OUTLINE, drawTitleOutline() );
|
||||
group.writeEntry( OxygenConfig::HIDE_TITLEBAR, hideTitleBar() );
|
||||
group.writeEntry( OxygenConfig::USE_DROP_SHADOWS, useDropShadows() );
|
||||
group.writeEntry( OxygenConfig::USE_OXYGEN_SHADOWS, useOxygenShadows() );
|
||||
group.writeEntry( OxygenConfig::USE_ANIMATIONS, useAnimations() );
|
||||
group.writeEntry( OxygenConfig::ANIMATE_TITLE_CHANGE, animateTitleChange() );
|
||||
|
@ -311,6 +318,7 @@ namespace Oxygen
|
|||
drawSeparator() == other.drawSeparator() &&
|
||||
drawTitleOutline() == other.drawTitleOutline() &&
|
||||
hideTitleBar() == other.hideTitleBar() &&
|
||||
useDropShadows() == other.useDropShadows() &&
|
||||
useOxygenShadows() == other.useOxygenShadows() &&
|
||||
useAnimations() == other.useAnimations() &&
|
||||
animateTitleChange() == other.animateTitleChange() &&
|
||||
|
|
|
@ -38,6 +38,7 @@ namespace OxygenConfig
|
|||
static const QString FRAME_BORDER = "FrameBorder";
|
||||
static const QString BLEND_COLOR = "BlendColor";
|
||||
static const QString SIZE_GRIP_MODE = "SizeGripMode";
|
||||
static const QString USE_DROP_SHADOWS = "UseDropShadows";
|
||||
static const QString USE_OXYGEN_SHADOWS = "UseOxygenShadows";
|
||||
static const QString HIDE_TITLEBAR = "HideTitleBar";
|
||||
static const QString USE_ANIMATIONS = "UseAnimations";
|
||||
|
@ -243,6 +244,14 @@ namespace Oxygen
|
|||
virtual void setHideTitleBar( bool value )
|
||||
{ hideTitleBar_ = value; }
|
||||
|
||||
//! drop shadows
|
||||
virtual bool useDropShadows( void ) const
|
||||
{ return useDropShadows_; }
|
||||
|
||||
//! drop shadows
|
||||
virtual void setUseDropShadows( bool value )
|
||||
{ useDropShadows_ = value; }
|
||||
|
||||
//! oxygen shadows
|
||||
virtual bool useOxygenShadows( void ) const
|
||||
{ return useOxygenShadows_; }
|
||||
|
@ -309,6 +318,9 @@ namespace Oxygen
|
|||
//! hide titlebar completely (but not window border)
|
||||
bool hideTitleBar_;
|
||||
|
||||
//! drop shadows
|
||||
bool useDropShadows_;
|
||||
|
||||
//! oxygen shadows
|
||||
bool useOxygenShadows_;
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ namespace Oxygen
|
|||
|
||||
static const qreal fixedSize = 25.5;
|
||||
qreal size( shadowSize() );
|
||||
qreal shadowSize( shadowConfiguration.shadowSize() );
|
||||
qreal shadowSize( shadowConfiguration.isEnabled() ? shadowConfiguration.shadowSize():0 );
|
||||
|
||||
QPixmap shadow = QPixmap( size*2, size*2 );
|
||||
shadow.fill( Qt::transparent );
|
||||
|
|
|
@ -74,7 +74,9 @@ namespace Oxygen
|
|||
//! shadow size
|
||||
qreal shadowSize( void ) const
|
||||
{
|
||||
qreal size( qMax( activeShadowConfiguration_.shadowSize(), inactiveShadowConfiguration_.shadowSize() ) );
|
||||
qreal activeSize( activeShadowConfiguration_.isEnabled() ? activeShadowConfiguration_.shadowSize():0 );
|
||||
qreal inactiveSize( inactiveShadowConfiguration_.isEnabled() ? inactiveShadowConfiguration_.shadowSize():0 );
|
||||
qreal size( qMax( activeSize, inactiveSize ) );
|
||||
|
||||
// even if shadows are disabled,
|
||||
// you need a minimum size to allow corner rendering
|
||||
|
|
|
@ -33,7 +33,8 @@ namespace Oxygen
|
|||
|
||||
//_________________________________________________________
|
||||
OxygenShadowConfiguration::OxygenShadowConfiguration( QPalette::ColorGroup colorGroup ):
|
||||
colorGroup_( colorGroup )
|
||||
colorGroup_( colorGroup ),
|
||||
enabled_( true )
|
||||
{
|
||||
|
||||
// check colorgroup
|
||||
|
@ -69,7 +70,8 @@ namespace Oxygen
|
|||
|
||||
//_________________________________________________________
|
||||
OxygenShadowConfiguration::OxygenShadowConfiguration( QPalette::ColorGroup colorGroup, KConfigGroup group ):
|
||||
colorGroup_( colorGroup )
|
||||
colorGroup_( colorGroup ),
|
||||
enabled_( true )
|
||||
{
|
||||
|
||||
// get default configuration
|
||||
|
|
|
@ -66,6 +66,14 @@ namespace Oxygen
|
|||
QPalette::ColorGroup colorGroup( void ) const
|
||||
{ return colorGroup_; }
|
||||
|
||||
//! enability
|
||||
void setEnabled( bool value )
|
||||
{ enabled_ = value; }
|
||||
|
||||
//! enability
|
||||
bool isEnabled( void ) const
|
||||
{ return enabled_; }
|
||||
|
||||
//! shadow size
|
||||
qreal shadowSize( void ) const
|
||||
{ return shadowSize_; }
|
||||
|
@ -121,6 +129,7 @@ namespace Oxygen
|
|||
{
|
||||
return
|
||||
colorGroup_ == other.colorGroup_ &&
|
||||
enabled_ == other.enabled_ &&
|
||||
shadowSize_ == other.shadowSize_ &&
|
||||
horizontalOffset_ == other.horizontalOffset_ &&
|
||||
verticalOffset_ == other.verticalOffset_ &&
|
||||
|
@ -152,6 +161,9 @@ namespace Oxygen
|
|||
//! color group
|
||||
QPalette::ColorGroup colorGroup_;
|
||||
|
||||
//! enability
|
||||
bool enabled_;
|
||||
|
||||
//! shadow size
|
||||
qreal shadowSize_;
|
||||
|
||||
|
|
Loading…
Reference in a new issue