mirror of
https://gitgud.io/wackyideas/aerothemeplasma.git
synced 2024-08-15 00:43:43 +00:00
Very early KDE 6 release.
This commit is contained in:
parent
7cc4ccabbc
commit
686046d4f7
6272 changed files with 140920 additions and 529657 deletions
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick 2.0
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.kirigami 2.20 as Kirigami
|
||||
import org.kde.ksvg as KSvg
|
||||
import "../osd"
|
||||
|
||||
KSvg.FrameSvgItem {
|
||||
id: osd
|
||||
|
||||
property alias timeout: osdItem.timeout
|
||||
property alias osdValue: osdItem.osdValue
|
||||
property alias osdMaxValue: osdItem.osdMaxValue
|
||||
property alias icon: osdItem.icon
|
||||
property alias showingProgress: osdItem.showingProgress
|
||||
|
||||
objectName: "onScreenDisplay"
|
||||
visible: false
|
||||
width: osdItem.width + margins.left + margins.right
|
||||
height: osdItem.height + margins.top + margins.bottom
|
||||
imagePath: "widgets/background"
|
||||
|
||||
function show() {
|
||||
osd.visible = true;
|
||||
hideAnimation.restart();
|
||||
}
|
||||
|
||||
// avoid leaking ColorScope of lock screen theme into the OSD "popup"
|
||||
Item {
|
||||
width: osdItem.width
|
||||
height: osdItem.height
|
||||
anchors.centerIn: parent
|
||||
//Kirigami.Theme.colorSet: Kirigami.Theme.Normal
|
||||
|
||||
OsdItem {
|
||||
id: osdItem
|
||||
}
|
||||
}
|
||||
|
||||
SequentialAnimation {
|
||||
id: hideAnimation
|
||||
// prevent press and hold from flickering
|
||||
PauseAnimation { duration: Kirigami.Units.shortDuration }
|
||||
NumberAnimation {
|
||||
target: osd
|
||||
property: "opacity"
|
||||
from: 1
|
||||
to: 0
|
||||
duration: osd.timeout
|
||||
easing.type: Easing.InQuad
|
||||
}
|
||||
ScriptAction {
|
||||
script: {
|
||||
osd.visible = false;
|
||||
osd.opacity = 1;
|
||||
osd.icon = "";
|
||||
osd.osdValue = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick 2.5
|
||||
import QtQuick.Controls
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.private.sessions 2.0
|
||||
import "../components"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property bool debug: false
|
||||
property string notification
|
||||
signal clearPassword()
|
||||
signal notificationRepeated()
|
||||
|
||||
// These are magical properties that kscreenlocker looks for
|
||||
property bool viewVisible: false
|
||||
property bool suspendToRamSupported: false
|
||||
property bool suspendToDiskSupported: false
|
||||
|
||||
// These are magical signals that kscreenlocker looks for
|
||||
signal suspendToDisk()
|
||||
signal suspendToRam()
|
||||
|
||||
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
|
||||
LayoutMirroring.childrenInherit: true
|
||||
|
||||
implicitWidth: 800
|
||||
implicitHeight: 600
|
||||
|
||||
LockScreenUi {
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
|
@ -0,0 +1,588 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQml 2.15
|
||||
import QtQuick 2.8
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.1
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import QtCore
|
||||
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.private.keyboardindicator as KeyboardIndicator
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents3
|
||||
import org.kde.plasma.workspace.components 2.0 as PW
|
||||
import org.kde.kirigami 2.20 as Kirigami
|
||||
import org.kde.kscreenlocker 1.0 as ScreenLocker
|
||||
import org.kde.kirigamiaddons.sounds
|
||||
import QtMultimedia
|
||||
import org.kde.plasma.plasma5support as Plasma5Support
|
||||
//import org.kde.breeze.components
|
||||
|
||||
import org.kde.plasma.private.sessions 2.0
|
||||
import "../components"
|
||||
|
||||
Item {
|
||||
|
||||
id: lockScreenUi
|
||||
// If we're using software rendering, draw outlines instead of shadows
|
||||
// See https://bugs.kde.org/show_bug.cgi?id=398317
|
||||
readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software
|
||||
property bool hadPrompt: false;
|
||||
property int currentPage: 0;
|
||||
|
||||
Kirigami.Theme.colorSet: Kirigami.Theme.Complementary
|
||||
Kirigami.Theme.inherit: false
|
||||
//colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
||||
|
||||
|
||||
Rectangle {
|
||||
id: blackRect
|
||||
anchors.fill: parent
|
||||
color: "black"
|
||||
z: 99
|
||||
opacity: 0
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: 600 }
|
||||
}
|
||||
}
|
||||
Timer {
|
||||
id: graceLockTimer
|
||||
interval: 3000
|
||||
onTriggered: {
|
||||
root.clearPassword();
|
||||
authenticator.startAuthenticating();
|
||||
}
|
||||
}
|
||||
Timer {
|
||||
id: successTimer
|
||||
interval: 800
|
||||
onTriggered: {
|
||||
Qt.quit();
|
||||
}
|
||||
}
|
||||
function setWrongPasswordScreen(msg) {
|
||||
root.clearPassword();
|
||||
currentMessage.text = msg;
|
||||
currentMessageIcon.source = "dialog-error";
|
||||
currentPage = 2;
|
||||
dismissButton.focus = true;
|
||||
//graceLockTimer.restart();
|
||||
}
|
||||
|
||||
// This is probably the worst code I've ever written, just so that I can play a themed sound file slightly earlier, on time, instead of letting Plasma decide,
|
||||
// because Plasma plays the sounds too early/too late for this to be accurate, the biggest offender being the sound that plays when the user successfully logs
|
||||
// back into the session. Plasma plays it right as kscreenlocker closes, which is too late and sounds jarring as a result.
|
||||
// It literally executes a kreadconfig to read kdeglobals to extract the sound theme because I cannot for the life of me find the appropriate API calls
|
||||
// and then it manually *searches* for the appropriate sound file, because the SoundsModel component provided by kirigamiaddons (the only thing I could)
|
||||
// actually find at all, does not have a standard way of representing these sounds at all.
|
||||
Plasma5Support.DataSource {
|
||||
id: executable
|
||||
engine: "executable"
|
||||
connectedSources: []
|
||||
onNewData: (sourceName, data) => {
|
||||
var stdout = data["stdout"]
|
||||
exited(stdout)
|
||||
disconnectSource(sourceName) // cmd finished
|
||||
}
|
||||
function exec(cmd) {
|
||||
if (cmd) {
|
||||
connectSource(cmd)
|
||||
}
|
||||
}
|
||||
signal exited(string stdout)
|
||||
}
|
||||
Connections {
|
||||
target: executable
|
||||
function onExited(stdout) {
|
||||
soundsModel.theme = stdout.trim() ? stdout.trim() : "ocean";
|
||||
for(var i = 0; i < soundsModel.rowCount(); i++) {
|
||||
var str = soundsModel.initialSourceUrl(i);
|
||||
if(str.includes("desktop-login") && !str.endsWith(".license")) {
|
||||
lockSuccess.source = str;
|
||||
break;
|
||||
}
|
||||
/*if(str.includes("desktop-logout") && !str.endsWith(".license")) {
|
||||
lockSound.source = str;
|
||||
lockSound.play();
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
SoundsModel {
|
||||
id: soundsModel
|
||||
}
|
||||
MediaPlayer {
|
||||
id: lockSuccess
|
||||
audioOutput: AudioOutput {}
|
||||
}
|
||||
/*MediaPlayer {
|
||||
id: lockSound
|
||||
audioOutput: AudioOutput {}
|
||||
}*/
|
||||
|
||||
Connections {
|
||||
target: authenticator
|
||||
function onFailed(kind) {
|
||||
if (kind != 0) { // if this is coming from the noninteractive authenticators
|
||||
return;
|
||||
}
|
||||
if (root.notification) {
|
||||
root.notification += "\n"
|
||||
}
|
||||
setWrongPasswordScreen("The user name or password is incorrect.");
|
||||
lockScreenUi.hadPrompt = false;
|
||||
}
|
||||
function onSucceeded() {
|
||||
if (lockScreenUi.hadPrompt) {
|
||||
blackRect.opacity = 1;
|
||||
lockSuccess.play();
|
||||
successTimer.start();
|
||||
} else {
|
||||
currentPage = 4;
|
||||
noPasswordArea.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
function onInfoMessageChanged() {
|
||||
root.clearPassword();
|
||||
currentMessage.text = authenticator.infoMessage;
|
||||
currentMessageIcon.source = "dialog-info";
|
||||
currentPage = 2;
|
||||
dismissButton.focus = true;
|
||||
}
|
||||
|
||||
function onErrorMessageChanged() {
|
||||
console.log("ERROR " + authenticator.errorMessage);
|
||||
}
|
||||
|
||||
function onPromptChanged() {
|
||||
root.notification = authenticator.prompt;
|
||||
passwordArea.mainPasswordBox.forceActiveFocus();
|
||||
lockScreenUi.hadPrompt = true;
|
||||
}
|
||||
function onPromptForSecretChanged() {
|
||||
passwordArea.mainPasswordBox.forceActiveFocus();
|
||||
lockScreenUi.hadPrompt = true;
|
||||
}
|
||||
}
|
||||
|
||||
SessionManagement {
|
||||
id: sessionManagement
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: sessionManagement
|
||||
function onAboutToSuspend() {
|
||||
root.clearPassword();
|
||||
}
|
||||
}
|
||||
|
||||
SessionsModel {
|
||||
id: sessionsModel
|
||||
showNewSessionEntry: false
|
||||
}
|
||||
|
||||
KeyboardIndicator.KeyState {
|
||||
id: capsLockState
|
||||
key: Qt.Key_CapsLock
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: changeSessionComponent
|
||||
active: false
|
||||
source: "ChangeSession.qml"
|
||||
visible: false
|
||||
}
|
||||
|
||||
WallpaperFader {
|
||||
anchors.fill: parent
|
||||
source: wallpaper
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: inputPanel
|
||||
state: "hidden"
|
||||
readonly property bool keyboardActive: item ? item.active : false
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: lockScreenUi.bottom
|
||||
}
|
||||
function showHide() {
|
||||
state = state == "hidden" ? "visible" : "hidden";
|
||||
}
|
||||
Component.onCompleted: {
|
||||
inputPanel.source = Qt.platform.pluginName.includes("wayland") ? "../components/VirtualKeyboard_wayland.qml" : "../components/VirtualKeyboard.qml"
|
||||
}
|
||||
|
||||
onKeyboardActiveChanged: {
|
||||
if (keyboardActive) {
|
||||
inputPanel.z = 99;
|
||||
state = "visible";
|
||||
} else {
|
||||
state = "hidden";
|
||||
}
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "visible"
|
||||
PropertyChanges {
|
||||
target: lockScreenRoot
|
||||
height: lockScreenUi.height - inputPanel.height;
|
||||
//y: 0 - inputPanel.height + passwordArea.height - (switchuserButton.height + switchuserButton.anchors.topMargin);
|
||||
}
|
||||
PropertyChanges {
|
||||
target: inputPanel
|
||||
y: lockScreenRoot.height - inputPanel.height
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hidden"
|
||||
PropertyChanges {
|
||||
target: lockScreenRoot
|
||||
height: lockScreenUi.height;
|
||||
}
|
||||
PropertyChanges {
|
||||
target: inputPanel
|
||||
y: lockScreenRoot.height - lockScreenRoot.height/4
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: [
|
||||
Transition {
|
||||
from: "hidden"
|
||||
to: "visible"
|
||||
SequentialAnimation {
|
||||
ScriptAction {
|
||||
script: {
|
||||
inputPanel.item.activated = true;
|
||||
Qt.inputMethod.show();
|
||||
}
|
||||
}
|
||||
ParallelAnimation {
|
||||
NumberAnimation {
|
||||
target: lockScreenRoot
|
||||
property: "height"
|
||||
duration: Kirigami.Units.longDuration
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
NumberAnimation {
|
||||
target: inputPanel
|
||||
property: "y"
|
||||
duration: Kirigami.Units.longDuration
|
||||
easing.type: Easing.OutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
Transition {
|
||||
from: "visible"
|
||||
to: "hidden"
|
||||
SequentialAnimation {
|
||||
ParallelAnimation {
|
||||
NumberAnimation {
|
||||
target: lockScreenRoot
|
||||
property: "height"
|
||||
duration: Kirigami.Units.longDuration
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
NumberAnimation {
|
||||
target: inputPanel
|
||||
property: "y"
|
||||
duration: Kirigami.Units.longDuration
|
||||
easing.type: Easing.InQuad
|
||||
}
|
||||
OpacityAnimator {
|
||||
target: inputPanel
|
||||
duration: Kirigami.Units.longDuration
|
||||
easing.type: Easing.InQuad
|
||||
}
|
||||
}
|
||||
ScriptAction {
|
||||
script: {
|
||||
inputPanel.item.activated = false;
|
||||
Qt.inputMethod.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: lockScreenRoot
|
||||
|
||||
property bool calledUnlock: false
|
||||
|
||||
Component.onCompleted: {
|
||||
executable.exec("kreadconfig6 --file ~/.config/kdeglobals --group Sounds --key Theme");
|
||||
if (!calledUnlock) {
|
||||
calledUnlock = true;
|
||||
authenticator.startAuthenticating();
|
||||
graceLockTimer.restart();
|
||||
}
|
||||
}
|
||||
|
||||
x: parent.x
|
||||
y: parent.y
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
hoverEnabled: true
|
||||
drag.filterChildren: true
|
||||
Keys.onEscapePressed: {
|
||||
if (inputPanel.keyboardActive) {
|
||||
inputPanel.showHide();
|
||||
}
|
||||
}
|
||||
Keys.onPressed: (event) => {
|
||||
event.accepted = false;
|
||||
}
|
||||
GenericButton {
|
||||
id: switchLayoutButton
|
||||
anchors {
|
||||
top: parent.top
|
||||
topMargin: 5
|
||||
left: parent.left
|
||||
leftMargin: 7
|
||||
}
|
||||
implicitWidth: 35
|
||||
implicitHeight: 28
|
||||
label.font.pointSize: 9
|
||||
label.font.capitalization: Font.AllUppercase
|
||||
focusPolicy: Qt.TabFocus
|
||||
Accessible.description: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Button to change keyboard layout", "Switch layout")
|
||||
|
||||
PW.KeyboardLayoutSwitcher {
|
||||
id: keyboardLayoutSwitcher
|
||||
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.NoButton
|
||||
}
|
||||
|
||||
text: keyboardLayoutSwitcher.layoutNames.shortName
|
||||
onClicked: keyboardLayoutSwitcher.keyboardLayout.switchToNextLayout()
|
||||
|
||||
visible: keyboardLayoutSwitcher.hasMultipleKeyboardLayouts
|
||||
}
|
||||
|
||||
ListModel {
|
||||
id: users
|
||||
|
||||
Component.onCompleted: {
|
||||
users.append({
|
||||
name: kscreenlocker_userName,
|
||||
realName: kscreenlocker_userName,
|
||||
icon: kscreenlocker_userImage,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MainBlock {
|
||||
id: passwordArea
|
||||
anchors.centerIn: parent
|
||||
visible: currentPage == 0
|
||||
focus: true
|
||||
|
||||
//enabled: !authenticator.busy
|
||||
enabled: !graceLockTimer.running
|
||||
onPasswordResult: (password) => {
|
||||
// Switch to the 'Welcome' screen
|
||||
currentPage = 1;
|
||||
authenticator.startAuthenticating();
|
||||
authenticator.respond(password);
|
||||
}
|
||||
|
||||
notificationMessage: {
|
||||
if (capsLockState.locked) {
|
||||
return i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Caps Lock is on");
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
NoPasswordUnlock {
|
||||
id: noPasswordArea
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: switchuserButton.top
|
||||
anchors.bottomMargin: 52
|
||||
visible: currentPage == 4
|
||||
onClicked: {
|
||||
Qt.quit();
|
||||
}
|
||||
}
|
||||
GenericButton {
|
||||
id: switchuserButton
|
||||
visible: currentPage == 0 || currentPage == 4
|
||||
label.font.pointSize: 11
|
||||
implicitWidth: 108
|
||||
implicitHeight: 28
|
||||
focusPolicy: Qt.TabFocus
|
||||
|
||||
Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch User")
|
||||
PlasmaComponents3.Label {
|
||||
font.pointSize: 11
|
||||
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch User")
|
||||
anchors.fill: parent
|
||||
anchors.bottomMargin: Kirigami.Units.smallSpacing / 2
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
renderType: Text.NativeRendering
|
||||
font.hintingPreference: Font.PreferFullHinting
|
||||
font.kerning: false
|
||||
elide: Text.ElideRight
|
||||
layer.enabled: true
|
||||
layer.effect: DropShadow {
|
||||
//visible: !softwareRendering
|
||||
horizontalOffset: 0
|
||||
verticalOffset: 1
|
||||
radius: 6
|
||||
samples: 14
|
||||
spread: 0.0001
|
||||
color: "#bf000000"
|
||||
}
|
||||
}
|
||||
onClicked: {
|
||||
sessionManagement.switchUser();
|
||||
//sessionsModel.startNewSession(true /* lock the screen too */)
|
||||
lockScreenRoot.state = ''
|
||||
passwordArea.mainPasswordBox.forceActiveFocus();
|
||||
}
|
||||
anchors {
|
||||
top: passwordArea.bottom
|
||||
topMargin: (currentPage == 4 ? 36 : 40) / (inputPanel.keyboardActive ? 4 : 1) // for some reason, Microsoft offset Windows 7's Switch User button a bit when in no password lock
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
visible: currentPage == 0 || currentPage == 4
|
||||
id: footer
|
||||
anchors {
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
margins: 34
|
||||
}
|
||||
|
||||
EoAButton {
|
||||
}
|
||||
|
||||
OSKButton {
|
||||
onClicked: {
|
||||
// Otherwise the password field loses focus and virtual keyboard
|
||||
// keystrokes get eaten
|
||||
passwordArea.mainPasswordBox.forceActiveFocus();
|
||||
inputPanel.showHide()
|
||||
}
|
||||
|
||||
visible: inputPanel.status == Loader.Ready
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: welcomePage
|
||||
visible: currentPage == 1
|
||||
anchors.fill: parent
|
||||
Status {
|
||||
id: statusText
|
||||
anchors.centerIn: parent
|
||||
anchors.verticalCenterOffset: -36
|
||||
statusText: i18nd("okular", "Welcome")
|
||||
speen: welcomePage.visible
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: messagePage
|
||||
visible: currentPage == 2
|
||||
anchors {
|
||||
bottom: switchuserButton.bottom
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
spacing: 0
|
||||
RowLayout {
|
||||
spacing: 10
|
||||
Kirigami.Icon {
|
||||
id: currentMessageIcon
|
||||
implicitHeight: 32
|
||||
implicitWidth: 32
|
||||
}
|
||||
Label {
|
||||
id: currentMessage
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
font.pointSize: 9
|
||||
|
||||
width: implicitWidth
|
||||
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"
|
||||
}
|
||||
}
|
||||
}
|
||||
Item {
|
||||
height: 40
|
||||
}
|
||||
GenericButton {
|
||||
id: dismissButton
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
font.pointSize: 11
|
||||
implicitWidth: 93
|
||||
implicitHeight: 28
|
||||
focusPolicy: Qt.TabFocus
|
||||
|
||||
Accessible.name: "OK"
|
||||
text: "OK"
|
||||
onClicked: {
|
||||
authenticator.startAuthenticating();
|
||||
currentPage = 0;
|
||||
passwordArea.mainPasswordBox.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RowLayout {
|
||||
anchors {
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
height: 96
|
||||
Rectangle { Layout.fillWidth: true }
|
||||
Image {
|
||||
id: watermark
|
||||
source: "../images/watermark.png"
|
||||
opacity: !inputPanel.keyboardActive
|
||||
}
|
||||
Rectangle { Layout.fillWidth: true }
|
||||
}
|
||||
|
||||
Loader {
|
||||
active: true
|
||||
source: "LockOsd.qml"
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
top: parent.top
|
||||
topMargin: Kirigami.Units.largeSpacing
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,269 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2016 David Edmundson <davidedmundson@kde.org>
|
||||
|
||||
SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick 2.8
|
||||
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents3
|
||||
import org.kde.kirigami 2.20 as Kirigami
|
||||
import org.kde.kscreenlocker 1.0 as ScreenLocker
|
||||
import "../components"
|
||||
|
||||
ColumnLayout {
|
||||
//id: sessionManager
|
||||
property Item mainPasswordBox: passwordBox
|
||||
property alias echoMode: passwordBox.echoMode
|
||||
property alias notificationMessage: notificationsLabel.text
|
||||
|
||||
/*
|
||||
* Login has been requested with the following username and password
|
||||
* If username field is visible, it will be taken from that, otherwise from the "name" property of the currentIndex
|
||||
*/
|
||||
signal passwordResult(string password)
|
||||
|
||||
|
||||
/*onUserSelected: {
|
||||
|
||||
}*/
|
||||
Component.onCompleted: {
|
||||
const nextControl = (passwordBox.visible ? passwordBox : loginButton);
|
||||
// Don't startLogin() here, because the signal is connected to the
|
||||
// Escape key as well, for which it wouldn't make sense to trigger
|
||||
// login. Using TabFocusReason, so that the loginButton gets the
|
||||
// visual highlight.
|
||||
nextControl.forceActiveFocus(Qt.TabFocusReason);
|
||||
}
|
||||
|
||||
function startLogin() {
|
||||
const password = passwordBox.text
|
||||
|
||||
// This is partly because it looks nicer, but more importantly it
|
||||
// works round a Qt bug that can trigger if the app is closed with a
|
||||
// TextField focused.
|
||||
//
|
||||
// See https://bugreports.qt.io/browse/QTBUG-55460
|
||||
loginButton.forceActiveFocus();
|
||||
passwordResult(password);
|
||||
}
|
||||
|
||||
|
||||
id: contents
|
||||
anchors.centerIn: parent
|
||||
spacing: 0
|
||||
PFPContainer {
|
||||
avatarPath: kscreenlocker_userImage
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
|
||||
Label {
|
||||
id: usernameDelegate
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
font.pointSize: 18
|
||||
|
||||
width: parent.width
|
||||
text: kscreenlocker_userName
|
||||
color: "white"
|
||||
horizontalAlignment: Text.AlignCenter
|
||||
renderType: Text.NativeRendering
|
||||
font.hintingPreference: Font.PreferFullHinting
|
||||
font.kerning: false
|
||||
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
|
||||
renderType: Text.NativeRendering
|
||||
font.hintingPreference: Font.PreferFullHinting
|
||||
font.kerning: false
|
||||
layer.enabled: true
|
||||
layer.effect: DropShadow {
|
||||
//visible: !softwareRendering
|
||||
horizontalOffset: 0
|
||||
verticalOffset: 1
|
||||
radius: 6
|
||||
samples: 14
|
||||
spread: 0.0001
|
||||
color: "#bf000000"
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
height: 6
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Item {
|
||||
height: loginButton.height
|
||||
width: loginButton.width
|
||||
}
|
||||
|
||||
/*AuthuiTextbox {
|
||||
id: passwordBox
|
||||
font.pointSize: 9
|
||||
implicitWidth: 225
|
||||
|
||||
placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Password")
|
||||
focus: true
|
||||
echoMode: TextInput.Password
|
||||
inputMethodHints: Qt.ImhHiddenText | Qt.ImhSensitiveData | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
|
||||
enabled: !authenticator.graceLocked
|
||||
revealPasswordButtonShown: true
|
||||
|
||||
// In Qt this is implicitly active based on focus rather than visibility
|
||||
// in any other application having a focussed invisible object would be weird
|
||||
// but here we are using to wake out of screensaver mode
|
||||
// We need to explicitly disable cursor flashing to avoid unnecessary renders
|
||||
cursorVisible: visible
|
||||
|
||||
onAccepted: {
|
||||
startLogin()
|
||||
}
|
||||
|
||||
//if empty and left or right is pressed change selection in user switch
|
||||
//this cannot be in keys.onLeftPressed as then it doesn't reach the password box
|
||||
Keys.onPressed: {
|
||||
if (event.key == Qt.Key_Left && !text) {
|
||||
userList.decrementCurrentIndex();
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key == Qt.Key_Right && !text) {
|
||||
userList.incrementCurrentIndex();
|
||||
event.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: root
|
||||
function onClearPassword() {
|
||||
passwordBox.forceActiveFocus()
|
||||
passwordBox.text = "";
|
||||
}
|
||||
}
|
||||
}*/
|
||||
AuthuiTextbox {
|
||||
id: passwordBox
|
||||
font.pointSize: 9
|
||||
implicitWidth: 225
|
||||
|
||||
placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Password")
|
||||
focus: true
|
||||
echoMode: TextInput.Password
|
||||
inputMethodHints: Qt.ImhHiddenText | Qt.ImhSensitiveData | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
|
||||
//enabled: !authenticator.graceLocked
|
||||
//revealPasswordButtonShown: true
|
||||
|
||||
// In Qt this is implicitly active based on focus rather than visibility
|
||||
// in any other application having a focussed invisible object would be weird
|
||||
// but here we are using to wake out of screensaver mode
|
||||
// We need to explicitly disable cursor flashing to avoid unnecessary renders
|
||||
cursorVisible: visible
|
||||
|
||||
onClicked: {
|
||||
loginButton.clicked()
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: root
|
||||
function onClearPassword() {
|
||||
passwordBox.forceActiveFocus()
|
||||
passwordBox.text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GoButton {
|
||||
id: loginButton
|
||||
|
||||
onClicked: startLogin()
|
||||
Keys.onEnterPressed: clicked()
|
||||
Keys.onReturnPressed: clicked()
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
spacing: 2
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
visible: notificationsLabel.text != ""
|
||||
Kirigami.Icon {
|
||||
source: "dialog-warning"
|
||||
implicitHeight: 16
|
||||
implicitWidth: 16
|
||||
}
|
||||
Label {
|
||||
id: notificationsLabel
|
||||
font.pointSize: 9
|
||||
|
||||
width: implicitWidth
|
||||
color: "white"
|
||||
}
|
||||
}
|
||||
Item {
|
||||
height: Math.max(16, notificationsLabel.height)
|
||||
visible: notificationsLabel.text == ""
|
||||
}
|
||||
component FailableLabel : PlasmaComponents3.Label {
|
||||
id: _failableLabel
|
||||
required property int kind
|
||||
required property string label
|
||||
|
||||
visible: authenticator.authenticatorTypes & kind
|
||||
text: label
|
||||
textFormat: Text.PlainText
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
|
||||
/*RejectPasswordAnimation {
|
||||
id: _rejectAnimation
|
||||
target: _failableLabel
|
||||
onFinished: _timer.restart()
|
||||
}*/
|
||||
|
||||
Connections {
|
||||
target: authenticator
|
||||
function onNoninteractiveError(kind, authenticator) {
|
||||
if (kind & _failableLabel.kind) {
|
||||
_failableLabel.text = Qt.binding(() => authenticator.errorMessage)
|
||||
_timer.restart()
|
||||
}
|
||||
}
|
||||
}
|
||||
Timer {
|
||||
id: _timer
|
||||
interval: Kirigami.Units.humanMoment
|
||||
onTriggered: {
|
||||
_failableLabel.text = Qt.binding(() => _failableLabel.label)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FailableLabel {
|
||||
kind: ScreenLocker.Authenticator.Fingerprint
|
||||
label: i18nd("plasma_shell_org.kde.plasma.desktop", "(or scan your fingerprint on the reader)")
|
||||
}
|
||||
FailableLabel {
|
||||
kind: ScreenLocker.Authenticator.Smartcard
|
||||
label: i18nd("plasma_shell_org.kde.plasma.desktop", "(or scan your smartcard)")
|
||||
}
|
||||
}
|
|
@ -0,0 +1,111 @@
|
|||
/*
|
||||
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
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents3
|
||||
import org.kde.kirigami 2.20 as Kirigami
|
||||
|
||||
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
|
||||
}
|
||||
Kirigami.Icon {
|
||||
id: faceIcon
|
||||
source: "user-symbolic"
|
||||
visible: (face.status == Image.Error || face.status == Image.Null)
|
||||
anchors.fill: parent
|
||||
anchors.margins: Kirigami.Units.gridUnit * 0.5 // because mockup says so...
|
||||
//colorGroup: PlasmaCore.ColorScope.colorGroup
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2014 David Edmundson <davidedmundson@kde.org>
|
||||
SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
|
||||
|
||||
SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Window 2.15
|
||||
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents3
|
||||
|
||||
Item {
|
||||
id: wrapper
|
||||
|
||||
// If we're using software rendering, draw outlines instead of shadows
|
||||
// See https://bugs.kde.org/show_bug.cgi?id=398317
|
||||
readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software
|
||||
|
||||
property bool isCurrent: true
|
||||
|
||||
property string name
|
||||
property string userName
|
||||
property string avatarPath
|
||||
property string iconSource
|
||||
property bool needsPassword
|
||||
property var vtNumber
|
||||
property bool constrainText: true
|
||||
property alias nameFontSize: usernameDelegate.font.pointSize
|
||||
property int fontSize: PlasmaCore.Theme.defaultFont.pointSize + 2
|
||||
signal clicked()
|
||||
|
||||
property real faceSize: PlasmaCore.Units.gridUnit * 7
|
||||
|
||||
opacity: isCurrent ? 1.0 : 0.5
|
||||
|
||||
Behavior on opacity {
|
||||
OpacityAnimator {
|
||||
duration: PlasmaCore.Units.longDuration
|
||||
}
|
||||
}
|
||||
|
||||
// Draw a translucent background circle under the user picture
|
||||
Rectangle {
|
||||
anchors.centerIn: imageSource
|
||||
width: imageSource.width - 2 // Subtract to prevent fringing
|
||||
height: width
|
||||
radius: width / 2
|
||||
|
||||
color: PlasmaCore.ColorScope.backgroundColor
|
||||
opacity: 0.6
|
||||
}
|
||||
|
||||
Item {
|
||||
id: imageSource
|
||||
anchors.top: parent.top
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
Behavior on width {
|
||||
PropertyAnimation {
|
||||
from: faceSize
|
||||
duration: PlasmaCore.Units.longDuration;
|
||||
}
|
||||
}
|
||||
width: isCurrent ? faceSize : faceSize - PlasmaCore.Units.largeSpacing
|
||||
height: width
|
||||
|
||||
//Image takes priority, taking a full path to a file, if that doesn't exist we show an icon
|
||||
Image {
|
||||
id: face
|
||||
source: wrapper.avatarPath
|
||||
sourceSize: Qt.size(faceSize * Screen.devicePixelRatio, faceSize * Screen.devicePixelRatio)
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
PlasmaCore.IconItem {
|
||||
id: faceIcon
|
||||
source: iconSource
|
||||
visible: (face.status == Image.Error || face.status == Image.Null)
|
||||
anchors.fill: parent
|
||||
anchors.margins: PlasmaCore.Units.gridUnit * 0.5 // because mockup says so...
|
||||
colorGroup: PlasmaCore.ColorScope.colorGroup
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents3.Label {
|
||||
id: usernameDelegate
|
||||
|
||||
anchors.top: imageSource.bottom
|
||||
anchors.topMargin: PlasmaCore.Units.gridUnit
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
// Make it bigger than other fonts to match the scale of the avatar better
|
||||
font.pointSize: wrapper.fontSize + 4
|
||||
|
||||
width: constrainText ? parent.width : implicitWidth
|
||||
text: wrapper.name
|
||||
style: softwareRendering ? Text.Outline : Text.Normal
|
||||
styleColor: softwareRendering ? PlasmaCore.ColorScope.backgroundColor : "transparent" //no outline, doesn't matter
|
||||
wrapMode: Text.WordWrap
|
||||
maximumLineCount: wrapper.constrainText ? 3 : 1
|
||||
elide: Text.ElideRight
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
//make an indication that this has active focus, this only happens when reached with keyboard navigation
|
||||
font.underline: wrapper.activeFocus
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
|
||||
onClicked: wrapper.clicked()
|
||||
}
|
||||
|
||||
Keys.onSpacePressed: wrapper.clicked()
|
||||
|
||||
Accessible.name: name
|
||||
Accessible.role: Accessible.Button
|
||||
function accessiblePressAction() { wrapper.clicked() }
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
Item {
|
||||
id: wallpaperFader
|
||||
property alias source: wallpaperBlur.source
|
||||
property real factor: 1
|
||||
|
||||
FastBlur { /* Forced by KDE for some reason to be able to show the background */
|
||||
id: wallpaperBlur
|
||||
anchors.fill: parent
|
||||
radius: 0
|
||||
}
|
||||
ShaderEffect {
|
||||
id: wallpaperShader
|
||||
anchors.fill: parent
|
||||
supportsAtlasTextures: true
|
||||
property var source: ShaderEffectSource {
|
||||
sourceItem: wallpaperBlur
|
||||
live: true
|
||||
hideSource: true
|
||||
textureMirroring: ShaderEffectSource.NoMirroring
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue