aerothemeplasma/plasma/shells/org.kde.plasma.desktop/contents/lockscreen/NoPasswordUnlock.qml

112 lines
2.9 KiB
QML
Raw Normal View History

2024-01-20 02:08:06 +00:00
/*
SPDX-FileCopyrightText: 2016 David Edmundson <davidedmundson@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick 2.2
import QtQuick.Layouts 1.1
2024-08-09 01:20:25 +00:00
import QtQuick.Controls 2.15
2024-01-20 02:08:06 +00:00
2024-08-09 01:20:25 +00:00
import Qt5Compat.GraphicalEffects
2024-01-20 02:08:06 +00:00
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3
2024-08-09 01:20:25 +00:00
import org.kde.kirigami 2.20 as Kirigami
2024-01-20 02:08:06 +00:00
import "../components"
ColumnLayout {
id: root
property alias containsMouse: mouseArea.containsMouse
spacing: 0
signal clicked
Item {
implicitWidth: 80
implicitHeight: 80
Layout.alignment: Qt.AlignHCenter
id: smolPFP
Item {
id: imageSource
anchors.centerIn: smolPFP
width: 48
height: 48
Image {
id: face
source: kscreenlocker_userImage
fillMode: Image.PreserveAspectCrop
anchors.fill: parent
}
2024-08-09 01:20:25 +00:00
Kirigami.Icon {
2024-01-20 02:08:06 +00:00
id: faceIcon
source: "user-symbolic"
visible: (face.status == Image.Error || face.status == Image.Null)
anchors.fill: parent
2024-08-09 01:20:25 +00:00
anchors.margins: Kirigami.Units.gridUnit * 0.5 // because mockup says so...
//colorGroup: PlasmaCore.ColorScope.colorGroup
2024-01-20 02:08:06 +00:00
}
}
Image {
id: imageFrame
anchors.fill: smolPFP
source: activeFocus ? (containsMouse ? "../images/pfpframesmolhoverfocused.png" : "../images/pfpframesmolfocused.png") : (containsMouse ? "../images/pfpframesmolhover.png" : "../images/pfpframesmol.png")
}
}
Label {
id: usernameDelegate
Layout.alignment: Qt.AlignHCenter
font.pointSize: 9
width: parent.width
text: kscreenlocker_userName
color: "white"
horizontalAlignment: Text.AlignCenter
layer.enabled: true
layer.effect: DropShadow {
//visible: !softwareRendering
horizontalOffset: 0
verticalOffset: 1
radius: 6
samples: 14
spread: 0.0001
color: "#bf000000"
}
}
Label {
Layout.alignment: Qt.AlignHCenter
font.pointSize: 9
width: implicitWidth
text: "Locked"
color: "white"
horizontalAlignment: Text.AlignCenter
layer.enabled: true
layer.effect: DropShadow {
//visible: !softwareRendering
horizontalOffset: 0
verticalOffset: 1
radius: 6
samples: 14
spread: 0.0001
color: "#bf000000"
}
}
MouseArea {
id: mouseArea
hoverEnabled: true
onClicked: root.clicked()
Keys.onEnterPressed: clicked()
Keys.onReturnPressed: clicked()
anchors.fill: parent
}
}