kcm/compositing: Don't reset animation speed to default value when running in plasma

When running in plasma, the animation speed slider is in General
Behavior KCM.

The Defaults button should not reset the animation speed slider because
it's hidden.

BUG: 442600
This commit is contained in:
Vlad Zahorodnii 2021-09-22 14:33:09 +03:00 committed by Nate Graham
parent c27e4df375
commit 0b95979751

View file

@ -253,8 +253,10 @@ void KWinCompositingKCM::defaults()
// unmanaged widgets
m_form.backend->setCurrentIndex(CompositingTypeIndex::OPENGL20_INDEX);
// corresponds to 1.0 seconds in s_animationMultipliers
m_form.animationDurationFactor->setValue(3);
if (!isRunningPlasma()) {
// corresponds to 1.0 seconds in s_animationMultipliers
m_form.animationDurationFactor->setValue(3);
}
}
void KWinCompositingKCM::save()
@ -274,8 +276,10 @@ void KWinCompositingKCM::save()
m_settings->setBackend(backend);
m_settings->setGlCore(glCore);
const auto animationDuration = s_animationMultipliers[m_form.animationDurationFactor->value()];
m_settings->setAnimationDurationFactor(animationDuration);
if (!isRunningPlasma()) {
const auto animationDuration = s_animationMultipliers[m_form.animationDurationFactor->value()];
m_settings->setAnimationDurationFactor(animationDuration);
}
m_settings->save();
KCModule::save();