Verified Commit 3613e4f8 authored by ivan tkachenko's avatar ivan tkachenko
Browse files

[kcms/workspaceoptions] Shorten conditional expressions and sync with langing kcm

parent 32aace18
Pipeline #190383 passed with stage
in 4 minutes and 16 seconds
......@@ -61,7 +61,7 @@ KCM.SimpleKCM {
// We want to show the slider in a logarithmic way. ie
// move from 4x, 3x, 2x, 1x, 0.5x, 0.25x, 0.125x
// 0 is a special case
// 0 is a special case, which means "instant speed / no animations"
ColumnLayout {
Kirigami.FormData.label: i18n("Animation speed:")
Kirigami.FormData.buddyFor: slider
......@@ -77,18 +77,11 @@ KCM.SimpleKCM {
to: 4
stepSize: 0.5
snapMode: QQC2.Slider.SnapAlways
onMoved: {
if(value === to) {
kcm.globalsSettings.animationDurationFactor = 0;
} else {
kcm.globalsSettings.animationDurationFactor = 1.0 / Math.pow(2, value);
}
}
value: if (kcm.globalsSettings.animationDurationFactor === 0) {
return slider.to;
} else {
return -(Math.log(kcm.globalsSettings.animationDurationFactor) / Math.log(2));
}
onMoved: kcm.globalsSettings.animationDurationFactor =
(value === to) ? 0 : (1.0 / Math.pow(2, value))
value: (kcm.globalsSettings.animationDurationFactor === 0)
? slider.to
: -(Math.log(kcm.globalsSettings.animationDurationFactor) / Math.log(2))
KCM.SettingStateBinding {
configObject: kcm.globalsSettings
......
......@@ -24,13 +24,7 @@ KCM.SimpleKCM {
Kirigami.FormData.label: i18n("Visual behavior:")
text: i18n("Display informational tooltips on mouse hover")
checked: kcm.plasmaSettings.delay > 0
onCheckedChanged: {
if (checked) {
kcm.plasmaSettings.delay = 0.7
} else {
kcm.plasmaSettings.delay = -1
}
}
onCheckedChanged: kcm.plasmaSettings.delay = (checked ? 0.7 : -1)
KCM.SettingStateBinding {
configObject: kcm.plasmaSettings
......@@ -56,7 +50,7 @@ KCM.SimpleKCM {
// We want to show the slider in a logarithmic way. ie
// move from 4x, 3x, 2x, 1x, 0.5x, 0.25x, 0.125x
// 0 is a special case
// 0 is a special case, which means "instant speed / no animations"
ColumnLayout {
Kirigami.FormData.label: i18n("Animation speed:")
Kirigami.FormData.buddyFor: slider
......@@ -68,18 +62,11 @@ KCM.SimpleKCM {
to: 4
stepSize: 0.5
snapMode: QQC2.Slider.SnapAlways
onMoved: {
if(value === to) {
kcm.globalsSettings.animationDurationFactor = 0;
} else {
kcm.globalsSettings.animationDurationFactor = 1.0 / Math.pow(2, value);
}
}
value: if (kcm.globalsSettings.animationDurationFactor === 0) {
return slider.to;
} else {
return -(Math.log(kcm.globalsSettings.animationDurationFactor) / Math.log(2));
}
onMoved: kcm.globalsSettings.animationDurationFactor =
(value === to) ? 0 : (1.0 / Math.pow(2, value))
value: (kcm.globalsSettings.animationDurationFactor === 0)
? slider.to
: -(Math.log(kcm.globalsSettings.animationDurationFactor) / Math.log(2))
KCM.SettingStateBinding {
configObject: kcm.globalsSettings
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment