Option to not dim kept above windows in dim inactive effect.

Thanks to Jin Liu for providing the patch.
FEATURE: 233639

svn path=/trunk/KDE/kdebase/workspace/; revision=1114493
This commit is contained in:
Martin Gräßlin 2010-04-13 18:42:05 +00:00
parent 1bcd9fe4f6
commit 11aeee10d5
4 changed files with 17 additions and 1 deletions

View file

@ -42,6 +42,7 @@ void DimInactiveEffect::reconfigure( ReconfigureFlags )
KConfigGroup conf = EffectsHandler::effectConfig("DimInactive");
dim_panels = conf.readEntry("DimPanels", false);
dim_desktop = conf.readEntry("DimDesktop", false);
dim_keepabove = conf.readEntry("DimKeepAbove", false);
dim_by_group = conf.readEntry("DimByGroup", true);
dim_strength = conf.readEntry("Strength", 25);
}
@ -88,6 +89,8 @@ bool DimInactiveEffect::dimWindow( const EffectWindow* w ) const
return false; // don't dim panels if configured so
if( w->isDesktop() && !dim_desktop )
return false; // don't dim the desktop if configured so
if( w->keepAbove() && !dim_keepabove )
return false; // don't dim keep-above windows if configured so
if( !w->isNormalWindow() && !w->isDialog() && !w->isDock() && !w->isDesktop())
return false; // don't dim more special window types
// don't dim unmanaged windows, grouping doesn't work for them and maybe dimming

View file

@ -48,6 +48,7 @@ class DimInactiveEffect
int dim_strength; // reduce saturation and brightness by this percentage
bool dim_panels; // do/don't dim also all panels
bool dim_desktop; // do/don't dim the desktop
bool dim_keepabove; // do/don't dim keep-above windows
bool dim_by_group; // keep visible all windows from the active window's group or only the active window
};

View file

@ -53,6 +53,7 @@ DimInactiveEffectConfig::DimInactiveEffectConfig(QWidget* parent, const QVariant
connect(m_ui->spinStrength, SIGNAL(valueChanged(int)), this, SLOT(changed()));
connect(m_ui->checkPanel, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(m_ui->checkDesktop, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(m_ui->checkKeepAbove, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(m_ui->checkGroup, SIGNAL(toggled(bool)), this, SLOT(changed()));
load();
@ -67,10 +68,12 @@ void DimInactiveEffectConfig::load()
int strength = conf.readEntry("Strength", 25);
bool panel = conf.readEntry("DimPanels", false);
bool desktop = conf.readEntry("DimDesktop", false);
bool keepabove = conf.readEntry("DimKeepAbove", false);
bool group = conf.readEntry("DimByGroup", true);
m_ui->spinStrength->setValue(strength);
m_ui->checkPanel->setChecked(panel);
m_ui->checkDesktop->setChecked(desktop);
m_ui->checkKeepAbove->setChecked(keepabove);
m_ui->checkGroup->setChecked(group);
emit changed(false);
@ -83,6 +86,7 @@ void DimInactiveEffectConfig::save()
conf.writeEntry("Strength", m_ui->spinStrength->value());
conf.writeEntry("DimPanels", m_ui->checkPanel->isChecked());
conf.writeEntry("DimDesktop", m_ui->checkDesktop->isChecked());
conf.writeEntry("DimKeepAbove", m_ui->checkKeepAbove->isChecked());
conf.writeEntry("DimByGroup", m_ui->checkGroup->isChecked());
conf.sync();
@ -97,6 +101,7 @@ void DimInactiveEffectConfig::defaults()
m_ui->spinStrength->setValue(25);
m_ui->checkPanel->setChecked(false);
m_ui->checkDesktop->setChecked(false);
m_ui->checkKeepAbove->setChecked(false);
m_ui->checkGroup->setChecked(true);
emit changed(true);
}

View file

@ -25,6 +25,13 @@
</widget>
</item>
<item row="3" column="0" colspan="3" >
<widget class="QCheckBox" name="checkKeepAbove" >
<property name="text" >
<string>Apply effect to &amp;keep-above windows</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3" >
<widget class="QCheckBox" name="checkGroup" >
<property name="text" >
<string>Apply effect to &amp;groups</string>
@ -76,7 +83,7 @@
</property>
</widget>
</item>
<item row="4" column="0" colspan="3" >
<item row="5" column="0" colspan="3" >
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>