Added option in oxygenrc to disable window background:

[Common]
UseBackgroundGradient=true

Option is hidden (no UI element) because of string freeze
Also removed decoration blend style option.
Background gradient is now always decided based on window flag.
CCBUG: 273423
icc-effect-5.14.5
Hugo Pereira Da Costa 2013-12-15 12:33:38 +01:00
parent d138d12261
commit 68014f2b55
8 changed files with 64 additions and 184 deletions

View File

@ -71,7 +71,6 @@ namespace Oxygen
connect( ui.titleAlignment, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
connect( ui.buttonSize, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
connect( ui.frameBorder, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
connect( ui.blendColor, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
connect( ui.titleOutline, SIGNAL(clicked()), SLOT(updateChanged()) );
connect( ui.drawSizeGrip, SIGNAL(clicked()), SLOT(updateChanged()) );
@ -106,7 +105,6 @@ namespace Oxygen
if( !_configuration ) return;
ui.titleAlignment->setCurrentIndex( _configuration->titleAlignment() );
ui.buttonSize->setCurrentIndex( _configuration->buttonSize() );
ui.blendColor->setCurrentIndex( _configuration->blendStyle() );
ui.frameBorder->setCurrentIndex( _configuration->frameBorder() );
ui.separatorMode->setCurrentIndex( _configuration->separatorMode() );
ui.drawSizeGrip->setChecked( _configuration->drawSizeGrip() );
@ -130,7 +128,6 @@ namespace Oxygen
// apply modifications from ui
_configuration->setTitleAlignment( ui.titleAlignment->currentIndex() );
_configuration->setButtonSize( ui.buttonSize->currentIndex() );
_configuration->setBlendStyle( ui.blendColor->currentIndex() );
_configuration->setFrameBorder( ui.frameBorder->currentIndex() );
_configuration->setSeparatorMode( ui.separatorMode->currentIndex() );
_configuration->setDrawSizeGrip( ui.drawSizeGrip->isChecked() );
@ -231,7 +228,6 @@ namespace Oxygen
if( ui.titleAlignment->currentIndex() != _configuration->titleAlignment() ) modified = true;
else if( ui.buttonSize->currentIndex() != _configuration->buttonSize() ) modified = true;
else if( ui.blendColor->currentIndex() != _configuration->blendStyle() ) modified = true;
else if( ui.frameBorder->currentIndex() != _configuration->frameBorder() ) modified = true;
else if( ui.separatorMode->currentIndex() != _configuration->separatorMode() ) modified = true;
else if( ui.drawSizeGrip->isChecked() != _configuration->drawSizeGrip() ) modified = true;

View File

@ -42,7 +42,6 @@ namespace Oxygen
// store checkboxes from ui into list
_checkBoxes.insert( FrameBorder, frameBorderCheckBox );
_checkBoxes.insert( BlendColor, blendColorCheckBox );
_checkBoxes.insert( SizeGripMode, sizeGripCheckBox );
_checkBoxes.insert( TitleOutline, titleOutlineCheckBox );
_checkBoxes.insert( DrawSeparator, separatorCheckBox );
@ -54,7 +53,6 @@ namespace Oxygen
connect( exceptionType, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
connect( exceptionEditor, SIGNAL(textChanged(QString)), SLOT(updateChanged()) );
connect( frameBorderComboBox, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
connect( blendColorComboBox, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
connect( sizeGripComboBox, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
connect( titleOutlineComboBox, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
connect( separatorComboBox, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
@ -76,7 +74,6 @@ namespace Oxygen
exceptionType->setCurrentIndex(_exception->exceptionType() );
exceptionEditor->setText( _exception->exceptionPattern() );
frameBorderComboBox->setCurrentIndex( _exception->frameBorder() );
blendColorComboBox->setCurrentIndex( _exception->blendStyle() );
sizeGripComboBox->setCurrentIndex( _exception->drawSizeGrip() );
separatorComboBox->setCurrentIndex( _exception->separatorMode() );
titleOutlineComboBox->setCurrentIndex( _exception->drawTitleOutline() );
@ -96,7 +93,6 @@ namespace Oxygen
_exception->setExceptionType( exceptionType->currentIndex() );
_exception->setExceptionPattern( exceptionEditor->text() );
_exception->setFrameBorder( frameBorderComboBox->currentIndex() );
_exception->setBlendStyle( blendColorComboBox->currentIndex() );
_exception->setDrawSizeGrip( sizeGripComboBox->currentIndex() );
_exception->setSeparatorMode( separatorComboBox->currentIndex() );
_exception->setDrawTitleOutline( titleOutlineComboBox->currentIndex() );
@ -120,7 +116,6 @@ namespace Oxygen
if( _exception->exceptionType() != exceptionType->currentIndex() ) modified = true;
else if( _exception->exceptionPattern() != exceptionEditor->text() ) modified = true;
else if( _exception->frameBorder() != frameBorderComboBox->currentIndex() ) modified = true;
else if( _exception->blendStyle() != blendColorComboBox->currentIndex() ) modified = true;
else if( _exception->drawSizeGrip() != sizeGripComboBox->currentIndex() ) modified = true;
else if( _exception->separatorMode() != separatorComboBox->currentIndex() ) modified = true;
else if( _exception->drawTitleOutline() != titleOutlineComboBox->currentIndex() ) modified = true;

View File

@ -17,16 +17,7 @@
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item>
@ -223,16 +214,7 @@
<string>Fine Tuning</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>4</number>
</property>
<item row="6" column="0" colspan="3">
@ -274,51 +256,6 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Bac&amp;kground style: </string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>blendColor</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KComboBox" name="blendColor">
<item>
<property name="text">
<string>Solid Color</string>
</property>
</item>
<item>
<property name="text">
<string>Radial Gradient</string>
</property>
</item>
<item>
<property name="text">
<string>Follow Style Hint</string>
</property>
</item>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0" colspan="3">
<widget class="QCheckBox" name="titleOutline">
<property name="text">
@ -360,6 +297,19 @@
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3">
@ -469,7 +419,6 @@
<tabstop>buttonSize</tabstop>
<tabstop>animationsEnabled</tabstop>
<tabstop>_expertModeButton</tabstop>
<tabstop>blendColor</tabstop>
<tabstop>separatorMode</tabstop>
<tabstop>titleOutline</tabstop>
<tabstop>narrowButtonSpacing</tabstop>

View File

@ -83,6 +83,45 @@
<string>Decoration Options</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="3" column="2">
<widget class="KComboBox" name="titleOutlineComboBox">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string comment="outline window title">Disabled</string>
</property>
</item>
<item>
<property name="text">
<string comment="outline window title">Enabled</string>
</property>
</item>
</widget>
</item>
<item row="4" column="2">
<widget class="KComboBox" name="separatorComboBox">
<property name="enabled">
<bool>false</bool>
</property>
<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="0" column="0">
<widget class="QCheckBox" name="frameBorderCheckBox">
<property name="text">
@ -90,42 +129,35 @@
</property>
</widget>
</item>
<item row="3" column="0">
<item row="2" column="0">
<widget class="QCheckBox" name="sizeGripCheckBox">
<property name="text">
<string>Add handle to resize windows with no border</string>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="3" column="0">
<widget class="QCheckBox" name="titleOutlineCheckBox">
<property name="text">
<string>Outline active window title:</string>
</property>
</widget>
</item>
<item row="5" column="0">
<item row="4" column="0">
<widget class="QCheckBox" name="separatorCheckBox">
<property name="text">
<string>Separator display:</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="blendColorCheckBox">
<property name="text">
<string>Background style:</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="3">
<item row="6" column="0" colspan="3">
<widget class="QCheckBox" name="hideTitleBar">
<property name="text">
<string>Hide window title bar</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="3">
<item row="5" column="0" colspan="3">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::HLine</enum>
@ -188,28 +220,6 @@
</widget>
</item>
<item row="2" column="2">
<widget class="KComboBox" name="blendColorComboBox">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Solid Color</string>
</property>
</item>
<item>
<property name="text">
<string>Radial Gradient</string>
</property>
</item>
<item>
<property name="text">
<string>Follow Style Hint</string>
</property>
</item>
</widget>
</item>
<item row="3" column="2">
<widget class="KComboBox" name="sizeGripComboBox">
<property name="enabled">
<bool>false</bool>
@ -226,45 +236,6 @@
</item>
</widget>
</item>
<item row="4" column="2">
<widget class="KComboBox" name="titleOutlineComboBox">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string comment="outline window title">Disabled</string>
</property>
</item>
<item>
<property name="text">
<string comment="outline window title">Enabled</string>
</property>
</item>
</widget>
</item>
<item row="5" column="2">
<widget class="KComboBox" name="separatorComboBox">
<property name="enabled">
<bool>false</bool>
</property>
<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>
</item>
@ -342,22 +313,6 @@
</hint>
</hints>
</connection>
<connection>
<sender>blendColorCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>blendColorComboBox</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>136</x>
<y>188</y>
</hint>
<hint type="destinationlabel">
<x>333</x>
<y>189</y>
</hint>
</hints>
</connection>
<connection>
<sender>sizeGripCheckBox</sender>
<signal>toggled(bool)</signal>

View File

@ -609,17 +609,9 @@ namespace Oxygen
{
// window background
if(
_configuration->blendStyle() == Configuration::BlendNone ||
( _configuration->blendStyle() == Configuration::BlendFromStyle &&
!helper().hasBackgroundGradient( windowId() )
) )
if( helper().hasBackgroundGradient( windowId() ) )
{
painter->fillRect( rect, palette.color( QPalette::Window ) );
} else {
int offset = layoutMetric( LM_OuterPaddingTop );
// radial gradient positionning
@ -629,6 +621,10 @@ namespace Oxygen
const QWidget* window( isPreview() ? this->widget() : widget->window() );
helper().renderWindowBackground(painter, rect, widget, window, palette, offset, height );
} else {
painter->fillRect( rect, palette.color( QPalette::Window ) );
}
// background pixmap

View File

@ -50,15 +50,6 @@
<default>BorderTiny</default>
</entry>
<entry name="BlendStyle" type = "Enum">
<choices>
<choice name="BlendNone" />
<choice name="BlendRadial" />
<choice name="BlendFromStyle" />
</choices>
<default>BlendFromStyle</default>
</entry>
<entry name="DrawSizeGrip" type = "Bool">
<default>true</default>
</entry>

View File

@ -75,7 +75,6 @@ namespace Oxygen
DrawSeparator = 1<<2,
TitleOutline = 1<<3,
FrameBorder = 1<<4,
BlendColor = 1<<5,
SizeGripMode = 1<<6
};

View File

@ -60,7 +60,6 @@ namespace Oxygen
// propagate all features found in mask to the output configuration
if( exception.mask() & FrameBorder ) configuration->setFrameBorder( exception.frameBorder() );
if( exception.mask() & BlendColor ) configuration->setBlendStyle( exception.blendStyle() );
if( exception.mask() & DrawSeparator ) configuration->setSeparatorMode( exception.separatorMode() );
if( exception.mask() & TitleOutline ) configuration->setDrawTitleOutline( exception.drawTitleOutline() );
if( exception.mask() & SizeGripMode ) configuration->setDrawSizeGrip( exception.drawSizeGrip() );