mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 22:33:08 +00:00
Add lock screen look-and-feel
This commit is contained in:
parent
0608967e10
commit
af8a4b506a
1 changed files with 33 additions and 40 deletions
|
|
@ -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,54 +60,47 @@ PlasmaCore.ColorScope {
|
||||||
id: kuser
|
id: kuser
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Controls.Popup {
|
||||||
anchors.fill: contents
|
visible: true
|
||||||
color: PlasmaCore.ColorScope.backgroundColor
|
|
||||||
radius: units.smallSpacing
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: contents
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
spacing: units.largeSpacing
|
|
||||||
width: Math.min(units.gridUnit * 20, root.width * 0.8)
|
width: Math.min(units.gridUnit * 20, root.width * 0.8)
|
||||||
height: Math.min(units.gridUnit * 25, root.height * 0.7)
|
height: Math.min(units.gridUnit * 25, root.height * 0.7)
|
||||||
|
Component.onCompleted: open()
|
||||||
UserDelegate {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
width: units.gridUnit * 7
|
|
||||||
height: width
|
|
||||||
nameFontSize: theme.defaultFont.pointSize + 4
|
|
||||||
constrainText: false
|
|
||||||
avatarPath: kuser.faceIconUrl
|
|
||||||
iconSource: "user-identity"
|
|
||||||
isCurrent: true
|
|
||||||
name: kuser.fullName
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
Controls.Button {
|
id: contents
|
||||||
|
spacing: units.largeSpacing
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
UserDelegate {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
display: Controls.Button.TextUnderIcon
|
width: units.gridUnit * 7
|
||||||
icon.name: "system-shutdown"
|
height: width
|
||||||
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Shut Down")
|
nameFontSize: theme.defaultFont.pointSize + 4
|
||||||
onClicked: root.haltRequested()
|
constrainText: false
|
||||||
|
avatarPath: kuser.faceIconUrl
|
||||||
|
iconSource: "user-identity"
|
||||||
|
isCurrent: true
|
||||||
|
name: kuser.fullName
|
||||||
}
|
}
|
||||||
|
|
||||||
Controls.Button {
|
ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.margins: 10
|
||||||
display: Controls.Button.TextUnderIcon
|
Controls.Button {
|
||||||
icon.name: "system-reboot"
|
Layout.fillWidth: true
|
||||||
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Restart")
|
display: Controls.Button.TextUnderIcon
|
||||||
onClicked: root.rebootRequested()
|
icon.name: "system-shutdown"
|
||||||
}
|
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Shut Down")
|
||||||
|
onClicked: root.haltRequested()
|
||||||
|
}
|
||||||
|
|
||||||
Controls.Button {
|
Controls.Button {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
display: Controls.Button.TextUnderIcon
|
display: Controls.Button.TextUnderIcon
|
||||||
icon.name: "system-lock-screen"
|
icon.name: "system-reboot"
|
||||||
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Lock screen")
|
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Restart")
|
||||||
onClicked: root.lockScreenRequested()
|
onClicked: root.rebootRequested()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue