Add lock screen look-and-feel

This commit is contained in:
Jonah Brüchert 2020-02-08 13:06:39 +01:00 committed by Marco Martin
parent 0608967e10
commit af8a4b506a

View file

@ -20,7 +20,7 @@
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
import QtQuick.Controls 2.12 as Controls import QtQuick.Controls 2.8 as Controls
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kcoreaddons 1.0 as KCoreAddons import org.kde.kcoreaddons 1.0 as KCoreAddons
@ -60,18 +60,17 @@ PlasmaCore.ColorScope {
id: kuser id: kuser
} }
Rectangle { Controls.Popup {
anchors.fill: contents visible: true
color: PlasmaCore.ColorScope.backgroundColor anchors.centerIn: parent
radius: units.smallSpacing width: Math.min(units.gridUnit * 20, root.width * 0.8)
} height: Math.min(units.gridUnit * 25, root.height * 0.7)
Component.onCompleted: open()
ColumnLayout { ColumnLayout {
id: contents id: contents
anchors.centerIn: parent
spacing: units.largeSpacing spacing: units.largeSpacing
width: Math.min(units.gridUnit * 20, root.width * 0.8) anchors.fill: parent
height: Math.min(units.gridUnit * 25, root.height * 0.7)
UserDelegate { UserDelegate {
Layout.fillWidth: true Layout.fillWidth: true
@ -86,6 +85,7 @@ PlasmaCore.ColorScope {
} }
ColumnLayout { ColumnLayout {
Layout.margins: 10
Controls.Button { Controls.Button {
Layout.fillWidth: true Layout.fillWidth: true
display: Controls.Button.TextUnderIcon display: Controls.Button.TextUnderIcon
@ -101,13 +101,6 @@ PlasmaCore.ColorScope {
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Restart") text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Restart")
onClicked: root.rebootRequested() onClicked: root.rebootRequested()
} }
Controls.Button {
Layout.fillWidth: true
display: Controls.Button.TextUnderIcon
icon.name: "system-lock-screen"
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Lock screen")
onClicked: root.lockScreenRequested()
} }
} }
} }