Changed 'drawSeparator' boolean value into a combobox, for which 3 choices are available:
- never draw separator - draw separator when window is active - always draw separator. This is usefull for e.g. firefox, when a flat background is used, in which case one might want the separator to always be enabled. svn path=/trunk/KDE/kdebase/workspace/; revision=1182027
This commit is contained in:
parent
ba5695602d
commit
881a43a191
9 changed files with 321 additions and 225 deletions
|
@ -115,7 +115,7 @@ namespace Oxygen
|
|||
else if( userInterface_->ui.shadowMode->currentIndex() != userInterface_->ui.shadowMode->findText( configuration.shadowModeName( true ) ) ) modified = true;
|
||||
else if( userInterface_->ui.shadowCacheMode->currentIndex() != userInterface_->ui.shadowCacheMode->findText( configuration.shadowCacheModeName( true ) ) ) modified = true;
|
||||
|
||||
else if( userInterface_->ui.drawSeparator->isChecked() != configuration.drawSeparator() ) modified = true;
|
||||
else if( userInterface_->ui.separatorMode->currentIndex() != configuration.separatorMode() ) modified = true;
|
||||
else if( userInterface_->ui.titleOutline->isChecked() != configuration.drawTitleOutline() ) modified = true;
|
||||
else if( userInterface_->shadowConfigurations[0]->isChecked() != configuration.useOxygenShadows() ) modified = true;
|
||||
else if( userInterface_->shadowConfigurations[1]->isChecked() != configuration.useDropShadows() ) modified = true;
|
||||
|
@ -170,7 +170,24 @@ namespace Oxygen
|
|||
OxygenConfig::SHADOW_CACHE_MODE,
|
||||
Configuration::shadowCacheModeName( Configuration::shadowCacheMode( userInterface_->ui.shadowCacheMode->currentText(), true ), false ) );
|
||||
|
||||
configurationGroup.writeEntry( OxygenConfig::DRAW_SEPARATOR, userInterface_->ui.drawSeparator->isChecked() );
|
||||
switch( userInterface_->ui.separatorMode->currentIndex() )
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
configurationGroup.writeEntry( OxygenConfig::DRAW_SEPARATOR, false );
|
||||
break;
|
||||
|
||||
case 1:
|
||||
configurationGroup.writeEntry( OxygenConfig::DRAW_SEPARATOR, true );
|
||||
configurationGroup.writeEntry( OxygenConfig::SEPARATOR_ACTIVE_ONLY, true );
|
||||
break;
|
||||
|
||||
case 2:
|
||||
configurationGroup.writeEntry( OxygenConfig::DRAW_SEPARATOR, true );
|
||||
configurationGroup.writeEntry( OxygenConfig::SEPARATOR_ACTIVE_ONLY, false );
|
||||
break;
|
||||
}
|
||||
|
||||
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() );
|
||||
|
@ -238,7 +255,7 @@ namespace Oxygen
|
|||
userInterface_->ui.frameBorder->setCurrentIndex( userInterface_->ui.frameBorder->findText( configuration.frameBorderName( true ) ) );
|
||||
userInterface_->ui.sizeGripMode->setCurrentIndex( userInterface_->ui.sizeGripMode->findText( configuration.sizeGripModeName( true ) ) );
|
||||
|
||||
userInterface_->ui.drawSeparator->setChecked( configuration.drawSeparator() );
|
||||
userInterface_->ui.separatorMode->setCurrentIndex( configuration.separatorMode() );
|
||||
userInterface_->ui.titleOutline->setChecked( configuration.drawTitleOutline() );
|
||||
userInterface_->shadowConfigurations[0]->setChecked( configuration.useOxygenShadows() );
|
||||
userInterface_->shadowConfigurations[1]->setChecked( configuration.useDropShadows() );
|
||||
|
|
|
@ -102,7 +102,7 @@ namespace Oxygen
|
|||
connect( ui.shadowMode, SIGNAL( currentIndexChanged(int)), SLOT(shadowModeChanged(int)) );
|
||||
connect( ui.shadowMode, SIGNAL( currentIndexChanged(int)), SIGNAL(changed()) );
|
||||
connect( ui.shadowCacheMode, SIGNAL( currentIndexChanged(int)), SIGNAL(changed()) );
|
||||
connect( ui.titleOutline, SIGNAL(toggled( bool )), ui.drawSeparator, SLOT( setDisabled( bool ) ) );
|
||||
connect( ui.titleOutline, SIGNAL(toggled( bool )), ui.separatorMode, SLOT( setDisabled( bool ) ) );
|
||||
|
||||
connect( shadowConfigurations[0], SIGNAL( changed() ), SIGNAL( changed() ) );
|
||||
connect( shadowConfigurations[0], SIGNAL( toggled( bool ) ), SIGNAL( changed() ) );
|
||||
|
@ -120,7 +120,7 @@ namespace Oxygen
|
|||
connect( ui.useAnimations, SIGNAL(clicked()), SIGNAL(changed()) );
|
||||
connect( ui.animateTitleChange, SIGNAL(clicked()), SIGNAL(changed()) );
|
||||
connect( ui.narrowButtonSpacing, SIGNAL(clicked()), SIGNAL(changed()) );
|
||||
connect( ui.drawSeparator, SIGNAL(clicked()), SIGNAL(changed()) );
|
||||
connect( ui.separatorMode, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) );
|
||||
connect( ui.titleOutline, SIGNAL(clicked()), SIGNAL(changed()) );
|
||||
connect( ui.exceptions, SIGNAL(changed()), SIGNAL(changed()) );
|
||||
|
||||
|
|
|
@ -93,7 +93,6 @@ namespace Oxygen
|
|||
connect( ui.titleOutlineCheckBox, SIGNAL( toggled( bool ) ), ui.titleOutlineComboBox, SLOT( setEnabled( bool ) ) );
|
||||
|
||||
// separator
|
||||
ui.separatorComboBox->insertItems(0, QStringList() << i18nc( "draw separator", "Enabled" ) << i18nc( "draw separator", "Disabled" ) );
|
||||
ui.separatorComboBox->setEnabled( false );
|
||||
checkboxes_.insert( std::make_pair( Exception::DrawSeparator, ui.separatorCheckBox ) );
|
||||
connect( ui.separatorCheckBox, SIGNAL( toggled( bool ) ), ui.separatorComboBox, SLOT( setEnabled( bool ) ) );
|
||||
|
@ -113,7 +112,7 @@ namespace Oxygen
|
|||
ui.frameBorderComboBox->setCurrentIndex( ui.frameBorderComboBox->findText( exception.frameBorderName( true ) ) );
|
||||
ui.blendColorComboBox->setCurrentIndex( ui.blendColorComboBox->findText( exception.blendColorName( true ) ) );
|
||||
ui.sizeGripComboBox->setCurrentIndex( ui.sizeGripComboBox->findText( exception.sizeGripModeName( true ) ) );
|
||||
ui.separatorComboBox->setCurrentIndex( ui.separatorComboBox->findText( exception.drawSeparator() ? i18nc( "draw separator", "Enabled" ) : i18nc( "draw separator", "Disabled" ) ) );
|
||||
ui.separatorComboBox->setCurrentIndex( exception.separatorMode() );
|
||||
ui.titleOutlineComboBox->setCurrentIndex( ui.titleOutlineComboBox->findText( exception.drawTitleOutline() ? i18nc( "outline window title", "Enabled" ) : i18nc( "outline window title", "Disabled" ) ) );
|
||||
ui.hideTitleBar->setChecked( exception.hideTitleBar() );
|
||||
|
||||
|
@ -134,7 +133,14 @@ namespace Oxygen
|
|||
exception.setSizeGripMode( Exception::sizeGripMode( ui.sizeGripComboBox->currentText(), true ) );
|
||||
|
||||
// flags
|
||||
exception.setDrawSeparator( ui.separatorComboBox->currentText() == i18nc( "draw separator", "Enabled" ) );
|
||||
switch( ui.separatorComboBox->currentIndex() )
|
||||
{
|
||||
default:
|
||||
case 0: exception.setSeparatorMode( Configuration::SeparatorNever ); break;
|
||||
case 1: exception.setSeparatorMode( Configuration::SeparatorActive ); break;
|
||||
case 2: exception.setSeparatorMode( Configuration::SeparatorAlways ); break;
|
||||
}
|
||||
|
||||
exception.setDrawTitleOutline( ui.titleOutlineComboBox->currentText() == i18nc( "outline window title", "Enabled" ) );
|
||||
exception.setHideTitleBar( ui.hideTitleBar->isChecked() );
|
||||
|
||||
|
|
|
@ -178,20 +178,13 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="3">
|
||||
<widget class="QCheckBox" name="drawSeparator">
|
||||
<property name="text">
|
||||
<string>Draw Separator between title bar and active window contents </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="3">
|
||||
<widget class="QCheckBox" name="narrowButtonSpacing">
|
||||
<property name="text">
|
||||
<string>Use narrow space between decoration buttons</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<item row="6" column="0">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
@ -220,6 +213,38 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="separatorMode">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Never Draw Separator</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Draw Separator When Window is Active</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Always Draw Separator</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Separator display:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>separatorMode</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="separatorCheckBox">
|
||||
<property name="text">
|
||||
<string>Draw separator between title bar and window contents: </string>
|
||||
<string>Separator display:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -134,7 +134,23 @@
|
|||
<widget class="KComboBox" name="titleOutlineComboBox"/>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="KComboBox" name="separatorComboBox"/>
|
||||
<widget class="KComboBox" name="separatorComboBox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Never Draw Separator</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Draw Separator When Window is Active</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Always Draw Separator</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
|
|
@ -93,11 +93,20 @@ namespace Oxygen
|
|||
//! true when separator is to be drawn
|
||||
bool drawSeparator( void ) const
|
||||
{
|
||||
return
|
||||
( glowIsAnimated() || isActive() ) &&
|
||||
configuration().drawSeparator() &&
|
||||
!configuration().hideTitleBar() &&
|
||||
!configuration().drawTitleOutline();
|
||||
if( configuration().drawTitleOutline() ) return false;
|
||||
switch( configuration().separatorMode() )
|
||||
{
|
||||
case Configuration::SeparatorAlways:
|
||||
return true;
|
||||
|
||||
case Configuration::SeparatorActive:
|
||||
return ( glowIsAnimated() || isActive() );
|
||||
|
||||
default:
|
||||
case Configuration::SeparatorNever:
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//@}
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace Oxygen
|
|||
frameBorder_( BorderTiny ),
|
||||
blendColor_( RadialBlending ),
|
||||
sizeGripMode_( SizeGripWhenNeeded ),
|
||||
drawSeparator_( false ),
|
||||
separatorMode_( SeparatorNever ),
|
||||
drawTitleOutline_( false ),
|
||||
hideTitleBar_( false ),
|
||||
useDropShadows_( true ),
|
||||
|
@ -84,10 +84,17 @@ namespace Oxygen
|
|||
group.readEntry( OxygenConfig::SIZE_GRIP_MODE,
|
||||
defaultConfiguration.sizeGripModeName( false ) ), false ) );
|
||||
|
||||
// draw separator
|
||||
setDrawSeparator( group.readEntry(
|
||||
OxygenConfig::DRAW_SEPARATOR,
|
||||
defaultConfiguration.drawSeparator() ) );
|
||||
// separator mode
|
||||
if( !group.readEntry( OxygenConfig::DRAW_SEPARATOR, defaultConfiguration.separatorMode() == SeparatorNever ) )
|
||||
{
|
||||
|
||||
setSeparatorMode( SeparatorNever );
|
||||
|
||||
} else if( group.readEntry( OxygenConfig::SEPARATOR_ACTIVE_ONLY, defaultConfiguration.separatorMode() == SeparatorActive ) ) {
|
||||
|
||||
setSeparatorMode( SeparatorActive );
|
||||
|
||||
} else setSeparatorMode( SeparatorAlways );
|
||||
|
||||
// title outline
|
||||
setDrawTitleOutline( group.readEntry(
|
||||
|
@ -154,7 +161,9 @@ namespace Oxygen
|
|||
group.writeEntry( OxygenConfig::FRAME_BORDER, frameBorderName( false ) );
|
||||
group.writeEntry( OxygenConfig::SIZE_GRIP_MODE, sizeGripModeName( false ) );
|
||||
|
||||
group.writeEntry( OxygenConfig::DRAW_SEPARATOR, drawSeparator() );
|
||||
group.writeEntry( OxygenConfig::DRAW_SEPARATOR, separatorMode() != SeparatorNever );
|
||||
group.writeEntry( OxygenConfig::SEPARATOR_ACTIVE_ONLY, separatorMode() == SeparatorActive );
|
||||
|
||||
group.writeEntry( OxygenConfig::DRAW_TITLE_OUTLINE, drawTitleOutline() );
|
||||
group.writeEntry( OxygenConfig::HIDE_TITLEBAR, hideTitleBar() );
|
||||
group.writeEntry( OxygenConfig::USE_DROP_SHADOWS, useDropShadows() );
|
||||
|
@ -331,7 +340,7 @@ namespace Oxygen
|
|||
frameBorder() == other.frameBorder() &&
|
||||
blendColor() == other.blendColor() &&
|
||||
sizeGripMode() == other.sizeGripMode() &&
|
||||
drawSeparator() == other.drawSeparator() &&
|
||||
separatorMode() == other.separatorMode() &&
|
||||
drawTitleOutline() == other.drawTitleOutline() &&
|
||||
hideTitleBar() == other.hideTitleBar() &&
|
||||
useDropShadows() == other.useDropShadows() &&
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace OxygenConfig
|
|||
static const QString TITLE_ALIGNMENT = "TitleAlignment";
|
||||
static const QString BUTTON_SIZE = "ButtonSize";
|
||||
static const QString DRAW_SEPARATOR = "DrawSeparator";
|
||||
static const QString SEPARATOR_ACTIVE_ONLY = "SeparatorActiveOnly";
|
||||
static const QString DRAW_TITLE_OUTLINE = "DrawTitleOutline";
|
||||
static const QString FRAME_BORDER = "FrameBorder";
|
||||
static const QString BLEND_COLOR = "BlendColor";
|
||||
|
@ -102,17 +103,30 @@ namespace Oxygen
|
|||
|
||||
//! shadow cache mode
|
||||
enum ShadowCacheMode {
|
||||
// no shadow cache
|
||||
//! no shadow cache
|
||||
CacheDisabled,
|
||||
|
||||
// shadow cache depends
|
||||
// on animation duration
|
||||
//! shadow cache depends on animation duration
|
||||
CacheVariable,
|
||||
|
||||
// shadow cache has maximum size
|
||||
//! shadow cache has maximum size
|
||||
CacheMaximum
|
||||
};
|
||||
|
||||
//! decide when separator is to be drawn
|
||||
enum SeparatorMode {
|
||||
|
||||
//! never
|
||||
SeparatorNever,
|
||||
|
||||
//! active window only
|
||||
SeparatorActive,
|
||||
|
||||
//! always
|
||||
SeparatorAlways
|
||||
|
||||
};
|
||||
|
||||
//! default constructor
|
||||
Configuration( void );
|
||||
|
||||
|
@ -275,12 +289,12 @@ namespace Oxygen
|
|||
//@}
|
||||
|
||||
//! separator
|
||||
virtual bool drawSeparator( void ) const
|
||||
{ return drawSeparator_; }
|
||||
virtual SeparatorMode separatorMode( void ) const
|
||||
{ return separatorMode_; }
|
||||
|
||||
//! separator
|
||||
virtual void setDrawSeparator( bool value )
|
||||
{ drawSeparator_ = value; }
|
||||
virtual void setSeparatorMode( SeparatorMode value )
|
||||
{ separatorMode_ = value; }
|
||||
|
||||
//! title outline
|
||||
virtual bool drawTitleOutline( void ) const
|
||||
|
@ -364,7 +378,7 @@ namespace Oxygen
|
|||
SizeGripMode sizeGripMode_;
|
||||
|
||||
//! separator
|
||||
bool drawSeparator_;
|
||||
SeparatorMode separatorMode_;
|
||||
|
||||
//! active window title outline
|
||||
bool drawTitleOutline_;
|
||||
|
|
|
@ -278,7 +278,7 @@ namespace Oxygen
|
|||
// propagate all features found in mask to the output configuration
|
||||
if( iter->mask() & Exception::FrameBorder ) configuration.setFrameBorder( iter->frameBorder() );
|
||||
if( iter->mask() & Exception::BlendColor ) configuration.setBlendColor( iter->blendColor() );
|
||||
if( iter->mask() & Exception::DrawSeparator ) configuration.setDrawSeparator( iter->drawSeparator() );
|
||||
if( iter->mask() & Exception::DrawSeparator ) configuration.setSeparatorMode( iter->separatorMode() );
|
||||
if( iter->mask() & Exception::TitleOutline ) configuration.setDrawTitleOutline( iter->drawTitleOutline() );
|
||||
if( iter->mask() & Exception::SizeGripMode ) configuration.setSizeGripMode( iter->sizeGripMode() );
|
||||
configuration.setHideTitleBar( iter->hideTitleBar() );
|
||||
|
|
Loading…
Reference in a new issue