Added option to dim the desktop with the dim inactive effect.

BUG: 152773

svn path=/trunk/KDE/kdebase/workspace/; revision=857307
icc-effect-5.14.5
Lucas Murray 2008-09-05 09:01:44 +00:00
parent 6fd9d4e4b3
commit 07fb6c6f38
4 changed files with 17 additions and 1 deletions

View File

@ -33,6 +33,7 @@ DimInactiveEffect::DimInactiveEffect()
KConfigGroup conf = EffectsHandler::effectConfig("DimInactive");
dim_panels = conf.readEntry("DimPanels", false);
dim_desktop = conf.readEntry("DimDesktop", false);
dim_by_group = conf.readEntry("DimByGroup", true);
dim_strength = conf.readEntry("Strength", 25);
active = effects->activeWindow();
@ -56,7 +57,9 @@ bool DimInactiveEffect::dimWindow( const EffectWindow* w ) const
return false; // don't dim in active group if configured so
if( w->isDock() && !dim_panels )
return false; // don't dim panels if configured so
if( !w->isNormalWindow() && !w->isDialog() && !w->isDock())
if( w->isDesktop() && !dim_desktop )
return false; // don't dim the desktop 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
// them doesn't make sense in general (they should be short-lived anyway)

View File

@ -41,6 +41,7 @@ class DimInactiveEffect
EffectWindow* active;
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_by_group; // keep visible all windows from the active window's group or only the active window
};

View File

@ -54,6 +54,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->checkGroup, SIGNAL(toggled(bool)), this, SLOT(changed()));
load();
@ -68,9 +69,11 @@ void DimInactiveEffectConfig::load()
int strength = conf.readEntry("Strength", 25);
bool panel = conf.readEntry("DimPanels", false);
bool desktop = conf.readEntry("DimDesktop", false);
bool group = conf.readEntry("DimByGroup", true);
m_ui->spinStrength->setValue(strength);
m_ui->checkPanel->setChecked(panel);
m_ui->checkDesktop->setChecked(desktop);
m_ui->checkGroup->setChecked(group);
emit changed(false);
@ -84,6 +87,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("DimByGroup", m_ui->checkGroup->isChecked());
conf.sync();
@ -98,6 +102,7 @@ void DimInactiveEffectConfig::defaults()
kDebug() ;
m_ui->spinStrength->setValue(25);
m_ui->checkPanel->setChecked(false);
m_ui->checkDesktop->setChecked(false);
m_ui->checkGroup->setChecked(true);
emit changed(true);
}

View File

@ -60,6 +60,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkDesktop" >
<property name="text" >
<string>Apply effect to the desk&amp;top</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkGroup" >
<property name="text" >