Added "Follow Style Hint" setting to the "fine tuning->background style" option

When selected, the decoration looks for a WM Hint set by the style, to decide whether or not it 
should draw a gradient in the background. 


svn path=/trunk/KDE/kdebase/workspace/; revision=1208665
This commit is contained in:
Hugo Pereira Da Costa 2010-12-22 19:23:46 +00:00
parent 9835858a4c
commit e43eff9792
5 changed files with 14 additions and 4 deletions

View file

@ -76,6 +76,7 @@ namespace Oxygen
ui.blendColor->insertItems(0, QStringList()
<< Configuration::blendColorName( Configuration::NoBlending, true )
<< Configuration::blendColorName( Configuration::RadialBlending, true )
<< Configuration::blendColorName( Configuration::BlendFromStyle, true )
);
// draw size grip

View file

@ -72,7 +72,9 @@ namespace Oxygen
// blend color
ui.blendColorComboBox->insertItems(0, QStringList()
<< Exception::blendColorName( Exception::NoBlending, true )
<< Exception::blendColorName( Exception::RadialBlending, true ) );
<< Exception::blendColorName( Exception::RadialBlending, true )
<< Exception::blendColorName( Exception::BlendFromStyle, true )
);
ui.blendColorComboBox->setEnabled( false );
checkboxes_.insert( std::make_pair( Exception::BlendColor, ui.blendColorCheckBox ) );
connect( ui.blendColorCheckBox, SIGNAL( toggled( bool ) ), ui.blendColorComboBox, SLOT( setEnabled( bool ) ) );

View file

@ -522,7 +522,11 @@ namespace Oxygen
void Client::renderWindowBackground( QPainter* painter, const QRect& rect, const QWidget* widget, const QPalette& palette ) const
{
if( configuration().blendColor() == Configuration::NoBlending )
if(
configuration().blendColor() == Configuration::NoBlending ||
( configuration().blendColor() == Configuration::BlendFromStyle &&
!helper().hasBackgroundGradient( windowId() )
) )
{
painter->fillRect( rect, palette.color( QPalette::Window ) );

View file

@ -37,7 +37,7 @@ namespace Oxygen
titleAlignment_( Qt::AlignHCenter ),
buttonSize_( ButtonDefault ),
frameBorder_( BorderTiny ),
blendColor_( RadialBlending ),
blendColor_( BlendFromStyle ),
sizeGripMode_( SizeGripWhenNeeded ),
separatorMode_( SeparatorNever ),
drawTitleOutline_( false ),
@ -306,6 +306,7 @@ namespace Oxygen
{
case NoBlending: out = translated ? i18n( "Solid Color" ):"Solid Color"; break;
case RadialBlending: out = translated ? i18n( "Radial Gradient" ):"Radial Gradient"; break;
case BlendFromStyle: out = translated ? i18n( "Follow Style Hint" ):"Follow Style Hint"; break;
default: return Configuration().blendColorName( translated );
}
@ -318,6 +319,7 @@ namespace Oxygen
{
if( value == blendColorName( NoBlending, translated ) ) return NoBlending;
else if( value == blendColorName( RadialBlending, translated ) ) return RadialBlending;
else if( value == blendColorName( BlendFromStyle, translated ) ) return BlendFromStyle;
else return Configuration().blendColor();
}

View file

@ -89,7 +89,8 @@ namespace Oxygen
//! blend color enumeration
enum BlendColorType {
NoBlending,
RadialBlending
RadialBlending,
BlendFromStyle
};
//! size grip mode