Commit 56a43f8e authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Lock Screen] Add option to hide clock when idle

This allows to use it for a slideshow or something.

Differential Revision: https://phabricator.kde.org/D24893
parent 328817b5
......@@ -38,6 +38,8 @@ Item {
property real factor: 0
readonly property bool lightBackground: Math.max(PlasmaCore.ColorScope.backgroundColor.r, PlasmaCore.ColorScope.backgroundColor.g, PlasmaCore.ColorScope.backgroundColor.b) > 0.5
property bool alwaysShowClock: typeof config === "undefined" || config.alwaysShowClock === true
Behavior on factor {
NumberAnimation {
target: wallpaperFader
......@@ -119,6 +121,10 @@ Item {
target: clock.shadow
opacity: 0
}
PropertyChanges {
target: clock
opacity: 1
}
},
State {
name: "off"
......@@ -136,7 +142,11 @@ Item {
}
PropertyChanges {
target: clock.shadow
opacity: 1
opacity: wallpaperFader.alwaysShowClock ? 1 : 0
}
PropertyChanges {
target: clock
opacity: wallpaperFader.alwaysShowClock ? 1 : 0
}
}
]
......@@ -145,37 +155,21 @@ Item {
from: "off"
to: "on"
//Note: can't use animators as they don't play well with parallelanimations
ParallelAnimation {
NumberAnimation {
target: mainStack
property: "opacity"
duration: units.longDuration
easing.type: Easing.InOutQuad
}
NumberAnimation {
target: footer
property: "opacity"
duration: units.longDuration
easing.type: Easing.InOutQuad
}
NumberAnimation {
targets: [mainStack, footer, clock]
property: "opacity"
duration: units.longDuration
easing.type: Easing.InOutQuad
}
},
Transition {
from: "on"
to: "off"
ParallelAnimation {
NumberAnimation {
target: mainStack
property: "opacity"
duration: 500
easing.type: Easing.InOutQuad
}
NumberAnimation {
target: footer
property: "opacity"
duration: 500
easing.type: Easing.InOutQuad
}
NumberAnimation {
targets: [mainStack, footer, clock]
property: "opacity"
duration: 500
easing.type: Easing.InOutQuad
}
}
]
......
......@@ -2,21 +2,43 @@ import QtQuick 2.5
import QtQuick.Controls 2.5 as QQC2
import QtQuick.Layouts 1.1
RowLayout {
ColumnLayout {
property alias cfg_alwaysShowClock: alwaysClock.checked
property alias cfg_showMediaControls: showMediaControls.checked
spacing: units.largeSpacing / 2
spacing: 0
QQC2.Label {
Layout.minimumWidth: formAlignment - units.largeSpacing //to match wallpaper config...
horizontalAlignment: Text.AlignRight
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Media controls:")
}
QQC2.CheckBox {
id: showMediaControls
text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "verb, to show something", "Show")
RowLayout {
spacing: units.largeSpacing / 2
QQC2.Label {
Layout.minimumWidth: formAlignment - units.largeSpacing //to match wallpaper config...
horizontalAlignment: Text.AlignRight
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Clock:")
}
QQC2.CheckBox {
id: alwaysClock
text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "verb, to show something", "Always show")
}
Item {
Layout.fillWidth: true
}
}
Item {
Layout.fillWidth: true
RowLayout {
spacing: units.largeSpacing / 2
QQC2.Label {
Layout.minimumWidth: formAlignment - units.largeSpacing //to match wallpaper config...
horizontalAlignment: Text.AlignRight
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Media controls:")
}
QQC2.CheckBox {
id: showMediaControls
text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "verb, to show something", "Show")
}
Item {
Layout.fillWidth: true
}
}
}
......@@ -6,6 +6,10 @@
<kcfgfile name=""/>
<group name="General">
<entry name="alwaysShowClock" type="Bool">
<label>If true, the clock is shown even when the computer is idle and the password prompt is hidden.</label>
<default>true</default>
</entry>
<entry name="showMediaControls" type="Bool">
<label>If true, shows any currently playing media along with controls to pause it.</label>
<default>true</default>
......
Markdown is supported
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