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,67 @@
|
|||
/*
|
||||
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.ksvg 1.0 as KSvg
|
||||
import org.kde.kirigami 2.20 as Kirigami
|
||||
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: "dialogs/background"
|
||||
|
||||
Kirigami.Theme.inherit: false
|
||||
Kirigami.Theme.colorSet: Kirigami.Theme.Window
|
||||
|
||||
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
|
||||
|
||||
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 org.kde.plasma.private.sessions 2.0
|
||||
import org.kde.breeze.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,421 @@
|
|||
/*
|
||||
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 org.kde.plasma.components 3.0 as PlasmaComponents3
|
||||
import org.kde.plasma.workspace.components 2.0 as PW
|
||||
import org.kde.plasma.private.keyboardindicator as KeyboardIndicator
|
||||
import org.kde.kirigami 2.20 as Kirigami
|
||||
import org.kde.kscreenlocker 1.0 as ScreenLocker
|
||||
|
||||
import org.kde.plasma.private.sessions 2.0
|
||||
import org.kde.breeze.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
|
||||
|
||||
function handleMessage(msg) {
|
||||
if (!root.notification) {
|
||||
root.notification += msg;
|
||||
} else if (root.notification.includes(msg)) {
|
||||
root.notificationRepeated();
|
||||
} else {
|
||||
root.notification += "\n" + msg
|
||||
}
|
||||
}
|
||||
|
||||
Kirigami.Theme.inherit: false
|
||||
Kirigami.Theme.colorSet: Kirigami.Theme.Complementary
|
||||
|
||||
Connections {
|
||||
target: authenticator
|
||||
function onFailed(kind) {
|
||||
if (kind != 0) { // if this is coming from the noninteractive authenticators
|
||||
return;
|
||||
}
|
||||
const msg = i18nd("plasma_shell_org.kde.plasma.desktop", "Unlocking failed");
|
||||
lockScreenUi.handleMessage(msg);
|
||||
graceLockTimer.restart();
|
||||
notificationRemoveTimer.restart();
|
||||
rejectPasswordAnimation.start();
|
||||
lockScreenUi.hadPrompt = false;
|
||||
}
|
||||
|
||||
function onSucceeded() {
|
||||
if (lockScreenUi.hadPrompt) {
|
||||
Qt.quit();
|
||||
} else {
|
||||
mainStack.replace(null, Qt.resolvedUrl("NoPasswordUnlock.qml"),
|
||||
{
|
||||
userListModel: users
|
||||
},
|
||||
StackView.Immediate,
|
||||
);
|
||||
mainStack.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
function onInfoMessageChanged() {
|
||||
lockScreenUi.handleMessage(authenticator.infoMessage);
|
||||
lockScreenUi.hadPrompt = true;
|
||||
}
|
||||
|
||||
function onErrorMessageChanged() {
|
||||
lockScreenUi.handleMessage(authenticator.errorMessage);
|
||||
}
|
||||
|
||||
function onPromptChanged(msg) {
|
||||
lockScreenUi.handleMessage(authenticator.prompt);
|
||||
}
|
||||
function onPromptForSecretChanged(msg) {
|
||||
mainBlock.showPassword = false;
|
||||
mainBlock.mainPasswordBox.forceActiveFocus();
|
||||
lockScreenUi.hadPrompt = true;
|
||||
}
|
||||
}
|
||||
|
||||
SessionManagement {
|
||||
id: sessionManagement
|
||||
}
|
||||
|
||||
KeyboardIndicator.KeyState {
|
||||
id: capsLockState
|
||||
key: Qt.Key_CapsLock
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: sessionManagement
|
||||
function onAboutToSuspend() {
|
||||
root.clearPassword();
|
||||
}
|
||||
}
|
||||
|
||||
RejectPasswordAnimation {
|
||||
id: rejectPasswordAnimation
|
||||
target: mainBlock
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: lockScreenRoot
|
||||
|
||||
property bool uiVisible: false
|
||||
property bool blockUI: mainStack.depth > 1 || mainBlock.mainPasswordBox.text.length > 0 || inputPanel.keyboardActive
|
||||
|
||||
x: parent.x
|
||||
y: parent.y
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
hoverEnabled: true
|
||||
cursorShape: uiVisible ? Qt.ArrowCursor : Qt.BlankCursor
|
||||
drag.filterChildren: true
|
||||
onPressed: uiVisible = true;
|
||||
onPositionChanged: uiVisible = true;
|
||||
onUiVisibleChanged: {
|
||||
|
||||
if (blockUI) {
|
||||
fadeoutTimer.running = false;
|
||||
} else if (uiVisible) {
|
||||
fadeoutTimer.restart();
|
||||
}
|
||||
authenticator.startAuthenticating();
|
||||
}
|
||||
onBlockUIChanged: {
|
||||
if (blockUI) {
|
||||
fadeoutTimer.running = false;
|
||||
uiVisible = true;
|
||||
} else {
|
||||
fadeoutTimer.restart();
|
||||
}
|
||||
}
|
||||
Keys.onEscapePressed: {
|
||||
// If the escape key is pressed, kscreenlocker will turn off the screen.
|
||||
// We do not want to show the password prompt in this case.
|
||||
if (uiVisible) {
|
||||
uiVisible = false;
|
||||
if (inputPanel.keyboardActive) {
|
||||
inputPanel.showHide();
|
||||
}
|
||||
root.clearPassword();
|
||||
}
|
||||
}
|
||||
Keys.onPressed: event => {
|
||||
uiVisible = true;
|
||||
event.accepted = false;
|
||||
}
|
||||
Timer {
|
||||
id: fadeoutTimer
|
||||
interval: 10000
|
||||
onTriggered: {
|
||||
if (!lockScreenRoot.blockUI) {
|
||||
mainBlock.mainPasswordBox.showPassword = false;
|
||||
lockScreenRoot.uiVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Timer {
|
||||
id: notificationRemoveTimer
|
||||
interval: 3000
|
||||
onTriggered: root.notification = ""
|
||||
}
|
||||
Timer {
|
||||
id: graceLockTimer
|
||||
interval: 3000
|
||||
onTriggered: {
|
||||
root.clearPassword();
|
||||
authenticator.startAuthenticating();
|
||||
}
|
||||
}
|
||||
|
||||
PropertyAnimation {
|
||||
id: launchAnimation
|
||||
target: lockScreenRoot
|
||||
property: "opacity"
|
||||
from: 0
|
||||
to: 1
|
||||
duration: Kirigami.Units.veryLongDuration * 2
|
||||
}
|
||||
|
||||
Component.onCompleted: launchAnimation.start();
|
||||
|
||||
WallpaperFader {
|
||||
anchors.fill: parent
|
||||
state: lockScreenRoot.uiVisible ? "on" : "off"
|
||||
source: wallpaper
|
||||
mainStack: mainStack
|
||||
footer: footer
|
||||
clock: clock
|
||||
}
|
||||
|
||||
DropShadow {
|
||||
id: clockShadow
|
||||
anchors.fill: clock
|
||||
source: clock
|
||||
visible: !softwareRendering
|
||||
radius: 6
|
||||
samples: 14
|
||||
spread: 0.3
|
||||
color : "black" // shadows should always be black
|
||||
Behavior on opacity {
|
||||
OpacityAnimator {
|
||||
duration: Kirigami.Units.veryLongDuration * 2
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Clock {
|
||||
id: clock
|
||||
property Item shadow: clockShadow
|
||||
visible: y > 0
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: (mainBlock.userList.y + mainStack.y)/2 - height/2
|
||||
Layout.alignment: Qt.AlignBaseline
|
||||
}
|
||||
|
||||
ListModel {
|
||||
id: users
|
||||
|
||||
Component.onCompleted: {
|
||||
users.append({
|
||||
name: kscreenlocker_userName,
|
||||
realName: kscreenlocker_userName,
|
||||
icon: kscreenlocker_userImage !== ""
|
||||
? "file://" + kscreenlocker_userImage.split("/").map(encodeURIComponent).join("/")
|
||||
: "",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
StackView {
|
||||
id: mainStack
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
height: lockScreenRoot.height + Kirigami.Units.gridUnit * 3
|
||||
focus: true //StackView is an implicit focus scope, so we need to give this focus so the item inside will have it
|
||||
|
||||
// this isn't implicit, otherwise items still get processed for the scenegraph
|
||||
visible: opacity > 0
|
||||
|
||||
initialItem: MainBlock {
|
||||
id: mainBlock
|
||||
lockScreenUiVisible: lockScreenRoot.uiVisible
|
||||
|
||||
showUserList: userList.y + mainStack.y > 0
|
||||
|
||||
enabled: !graceLockTimer.running
|
||||
|
||||
StackView.onStatusChanged: {
|
||||
// prepare for presenting again to the user
|
||||
if (StackView.status === StackView.Activating) {
|
||||
mainPasswordBox.clear();
|
||||
mainPasswordBox.focus = true;
|
||||
root.notification = "";
|
||||
}
|
||||
}
|
||||
userListModel: users
|
||||
|
||||
|
||||
notificationMessage: {
|
||||
const parts = [];
|
||||
if (capsLockState.locked) {
|
||||
console.log(authenticator);
|
||||
console.log(JSON.stringify(authenticator));
|
||||
parts.push(i18nd("plasma_shell_org.kde.plasma.desktop", "Caps Lock is on"));
|
||||
}
|
||||
if (root.notification) {
|
||||
parts.push(root.notification);
|
||||
}
|
||||
return parts.join(" • ");
|
||||
}
|
||||
|
||||
onPasswordResult: password => {
|
||||
authenticator.respond(password)
|
||||
}
|
||||
|
||||
actionItems: [
|
||||
ActionButton {
|
||||
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Eepy")
|
||||
iconSource: "system-suspend"
|
||||
onClicked: root.suspendToRam()
|
||||
visible: root.suspendToRamSupported
|
||||
},
|
||||
ActionButton {
|
||||
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Hibernate")
|
||||
iconSource: "system-suspend-hibernate"
|
||||
onClicked: root.suspendToDisk()
|
||||
visible: root.suspendToDiskSupported
|
||||
},
|
||||
ActionButton {
|
||||
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Switch User")
|
||||
iconSource: "system-switch-user"
|
||||
onClicked: {
|
||||
sessionManagement.switchUser();
|
||||
}
|
||||
visible: sessionManagement.canSwitchUser
|
||||
}
|
||||
]
|
||||
|
||||
Loader {
|
||||
Layout.topMargin: Kirigami.Units.smallSpacing // some distance to the password field
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: item ? item.implicitHeight : 0
|
||||
active: config.showMediaControls
|
||||
source: "MediaControls.qml"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VirtualKeyboardLoader {
|
||||
id: inputPanel
|
||||
|
||||
z: 1
|
||||
|
||||
screenRoot: lockScreenRoot
|
||||
mainStack: mainStack
|
||||
mainBlock: mainBlock
|
||||
passwordField: mainBlock.mainPasswordBox
|
||||
}
|
||||
|
||||
Loader {
|
||||
z: 2
|
||||
active: root.viewVisible
|
||||
source: "LockOsd.qml"
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
bottom: parent.bottom
|
||||
bottomMargin: Kirigami.Units.gridUnit
|
||||
}
|
||||
}
|
||||
|
||||
// Note: Containment masks stretch clickable area of their buttons to
|
||||
// the screen edges, essentially making them adhere to Fitts's law.
|
||||
// Due to virtual keyboard button having an icon, buttons may have
|
||||
// different heights, so fillHeight is required.
|
||||
//
|
||||
// Note for contributors: Keep this in sync with SDDM Main.qml footer.
|
||||
RowLayout {
|
||||
id: footer
|
||||
anchors {
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
margins: Kirigami.Units.smallSpacing
|
||||
}
|
||||
spacing: Kirigami.Units.smallSpacing
|
||||
|
||||
PlasmaComponents3.ToolButton {
|
||||
id: virtualKeyboardButton
|
||||
|
||||
focusPolicy: Qt.TabFocus
|
||||
text: i18ndc("plasma_shell_org.kde.plasma.desktop", "Button to show/hide virtual keyboard", "Virtual Keyboard")
|
||||
icon.name: inputPanel.keyboardActive ? "input-keyboard-virtual-on" : "input-keyboard-virtual-off"
|
||||
onClicked: {
|
||||
// Otherwise the password field loses focus and virtual keyboard
|
||||
// keystrokes get eaten
|
||||
mainBlock.mainPasswordBox.forceActiveFocus();
|
||||
inputPanel.showHide()
|
||||
}
|
||||
|
||||
visible: inputPanel.status === Loader.Ready
|
||||
|
||||
Layout.fillHeight: true
|
||||
containmentMask: Item {
|
||||
parent: virtualKeyboardButton
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: -footer.anchors.margins
|
||||
anchors.bottomMargin: -footer.anchors.margins
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents3.ToolButton {
|
||||
id: keyboardButton
|
||||
|
||||
focusPolicy: Qt.TabFocus
|
||||
Accessible.description: i18ndc("plasma_shell_org.kde.plasma.desktop", "Button to change keyboard layout", "Switch layout")
|
||||
icon.name: "input-keyboard"
|
||||
|
||||
PW.KeyboardLayoutSwitcher {
|
||||
id: keyboardLayoutSwitcher
|
||||
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.NoButton
|
||||
}
|
||||
|
||||
text: keyboardLayoutSwitcher.layoutNames.longName
|
||||
onClicked: keyboardLayoutSwitcher.keyboardLayout.switchToNextLayout()
|
||||
|
||||
visible: keyboardLayoutSwitcher.hasMultipleKeyboardLayouts
|
||||
|
||||
Layout.fillHeight: true
|
||||
containmentMask: Item {
|
||||
parent: keyboardButton
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: virtualKeyboardButton.visible ? 0 : -footer.anchors.margins
|
||||
anchors.bottomMargin: -footer.anchors.margins
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Battery {}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,162 @@
|
|||
/*
|
||||
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.12 as QQC2
|
||||
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents3
|
||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||
import org.kde.kirigami 2.20 as Kirigami
|
||||
import org.kde.kscreenlocker 1.0 as ScreenLocker
|
||||
|
||||
import org.kde.breeze.components
|
||||
|
||||
SessionManagementScreen {
|
||||
id: sessionManager
|
||||
|
||||
readonly property alias mainPasswordBox: passwordBox
|
||||
property bool lockScreenUiVisible: false
|
||||
property alias showPassword: passwordBox.showPassword
|
||||
|
||||
//the y position that should be ensured visible when the on screen keyboard is visible
|
||||
property int visibleBoundary: mapFromItem(loginButton, 0, 0).y
|
||||
onHeightChanged: visibleBoundary = mapFromItem(loginButton, 0, 0).y + loginButton.height + Kirigami.Units.smallSpacing
|
||||
/*
|
||||
* 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: {
|
||||
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);
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
|
||||
PlasmaExtras.PasswordField {
|
||||
id: passwordBox
|
||||
font.pointSize: Kirigami.Theme.defaultFont.pointSize + 1
|
||||
Layout.fillWidth: true
|
||||
|
||||
placeholderText: i18nd("plasma_shell_org.kde.plasma.desktop", "Password")
|
||||
focus: true
|
||||
enabled: !authenticator.graceLocked
|
||||
|
||||
// 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: {
|
||||
if (lockScreenUiVisible) {
|
||||
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: event => {
|
||||
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 = "";
|
||||
}
|
||||
function onNotificationRepeated() {
|
||||
sessionManager.playHighlightAnimation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents3.Button {
|
||||
id: loginButton
|
||||
Accessible.name: i18nd("plasma_shell_org.kde.plasma.desktop", "Unlock")
|
||||
Layout.preferredHeight: passwordBox.implicitHeight
|
||||
Layout.preferredWidth: loginButton.Layout.preferredHeight
|
||||
|
||||
icon.name: LayoutMirroring.enabled ? "go-previous" : "go-next"
|
||||
|
||||
onClicked: startLogin()
|
||||
Keys.onEnterPressed: clicked()
|
||||
Keys.onReturnPressed: clicked()
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
_rejectAnimation.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
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,118 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2016 Kai Uwe Broulik <kde@privat.broulik.de>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents3
|
||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||
import org.kde.kirigami 2 as Kirigami
|
||||
import org.kde.plasma.private.mpris as Mpris
|
||||
|
||||
Item {
|
||||
visible: instantiator.count > 0
|
||||
implicitHeight: Kirigami.Units.gridUnit * 3
|
||||
implicitWidth: Kirigami.Units.gridUnit * 16
|
||||
|
||||
Repeater {
|
||||
id: instantiator
|
||||
model: Mpris.MultiplexerModel { }
|
||||
|
||||
RowLayout {
|
||||
id: controlsRow
|
||||
|
||||
anchors.fill: parent
|
||||
spacing: 0
|
||||
enabled: model.canControl
|
||||
|
||||
Image {
|
||||
id: albumArt
|
||||
Layout.preferredWidth: height
|
||||
Layout.fillHeight: true
|
||||
visible: status === Image.Loading || status === Image.Ready
|
||||
asynchronous: true
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: model.artUrl
|
||||
sourceSize.height: height * Screen.devicePixelRatio
|
||||
}
|
||||
|
||||
Item { // spacer
|
||||
width: Kirigami.Units.smallSpacing
|
||||
height: 1
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 0
|
||||
|
||||
PlasmaComponents3.Label {
|
||||
Layout.fillWidth: true
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: Kirigami.Theme.defaultFont.pointSize + 1
|
||||
maximumLineCount: 1
|
||||
text: model.track.length > 0
|
||||
? model.track
|
||||
: (model.playbackStatus > Mpris.PlaybackStatus.Stopped
|
||||
? i18nd("plasma_shell_org.kde.plasma.desktop", "No title")
|
||||
: i18nd("plasma_shell_org.kde.plasma.desktop", "No media playing"))
|
||||
textFormat: Text.PlainText
|
||||
wrapMode: Text.NoWrap
|
||||
}
|
||||
|
||||
PlasmaExtras.DescriptiveLabel {
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.NoWrap
|
||||
elide: Text.ElideRight
|
||||
// if no artist is given, show player name instead
|
||||
text: model.artist || model.identity
|
||||
textFormat: Text.PlainText
|
||||
font.pointSize: Kirigami.Theme.smallFont.pointSize + 1
|
||||
maximumLineCount: 1
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents3.ToolButton {
|
||||
Layout.preferredHeight: Kirigami.Units.gridUnit * 2
|
||||
Layout.preferredWidth: Layout.preferredHeight
|
||||
visible: model.canGoBack || model.canGoNext
|
||||
enabled: model.canGoPrevious
|
||||
focusPolicy: Qt.TabFocus
|
||||
icon.name: LayoutMirroring.enabled ? "media-skip-forward" : "media-skip-backward"
|
||||
onClicked: {
|
||||
fadeoutTimer.running = false
|
||||
model.container.Previous()
|
||||
}
|
||||
Accessible.name: i18nd("plasma_shell_org.kde.plasma.desktop", "Previous track")
|
||||
}
|
||||
|
||||
PlasmaComponents3.ToolButton {
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: height // make this button bigger
|
||||
focusPolicy: Qt.TabFocus
|
||||
icon.name: model.playbackStatus === Mpris.PlaybackStatus.Playing ? "media-playback-pause" : "media-playback-start"
|
||||
onClicked: {
|
||||
fadeoutTimer.running = false
|
||||
model.container.PlayPause()
|
||||
}
|
||||
Accessible.name: i18nd("plasma_shell_org.kde.plasma.desktop", "Play or Pause media")
|
||||
}
|
||||
|
||||
PlasmaComponents3.ToolButton {
|
||||
Layout.preferredHeight: Kirigami.Units.gridUnit * 2
|
||||
Layout.preferredWidth: Layout.preferredHeight
|
||||
visible: model.canGoBack || model.canGoNext
|
||||
enabled: model.canGoNext
|
||||
focusPolicy: Qt.TabFocus
|
||||
icon.name: LayoutMirroring.enabled ? "media-skip-backward" : "media-skip-forward"
|
||||
Accessible.name: i18nd("plasma_shell_org.kde.plasma.desktop", "Next track")
|
||||
onClicked: {
|
||||
fadeoutTimer.running = false
|
||||
model.container.Next()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2022 David Edmundson <davidedmundson@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
import QtQuick 2.2
|
||||
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents3
|
||||
|
||||
import org.kde.breeze.components
|
||||
|
||||
SessionManagementScreen {
|
||||
focus: true
|
||||
PlasmaComponents3.Button {
|
||||
id: loginButton
|
||||
focus: true
|
||||
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Unlock")
|
||||
icon.name: "unlock"
|
||||
onClicked: Qt.quit();
|
||||
Keys.onEnterPressed: clicked()
|
||||
Keys.onReturnPressed: clicked()
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
forceActiveFocus();
|
||||
Qt.callLater(tryToSwitchUser, false)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
import QtQuick 2.5
|
||||
import QtQuick.Controls 2.5 as QQC2
|
||||
import QtQuick.Layouts 1.1
|
||||
import org.kde.kirigami 2.12 as Kirigami
|
||||
import org.kde.kcmutils as KCM
|
||||
|
||||
Kirigami.FormLayout {
|
||||
property alias cfg_alwaysShowClock: alwaysClock.checked
|
||||
property alias cfg_showMediaControls: showMediaControls.checked
|
||||
property bool cfg_alwaysShowClockDefault: false
|
||||
property bool cfg_showMediaControlsDefault: false
|
||||
|
||||
twinFormLayouts: parentLayout
|
||||
|
||||
QQC2.CheckBox {
|
||||
id: alwaysClock
|
||||
Kirigami.FormData.label: i18ndc("plasma_shell_org.kde.plasma.desktop",
|
||||
"@title: group",
|
||||
"Clock:")
|
||||
text: i18ndc("plasma_shell_org.kde.plasma.desktop",
|
||||
"@option:check",
|
||||
"Keep visible when unlocking prompt disappears")
|
||||
|
||||
KCM.SettingHighlighter {
|
||||
highlight: cfg_alwaysShowClockDefault != cfg_alwaysShowClock
|
||||
}
|
||||
}
|
||||
|
||||
QQC2.CheckBox {
|
||||
id: showMediaControls
|
||||
Kirigami.FormData.label: i18ndc("plasma_shell_org.kde.plasma.desktop",
|
||||
"@title: group",
|
||||
"Media controls:")
|
||||
text: i18ndc("plasma_shell_org.kde.plasma.desktop",
|
||||
"@option:check",
|
||||
"Show under unlocking prompt")
|
||||
|
||||
KCM.SettingHighlighter {
|
||||
highlight: cfg_showMediaControlsDefault != cfg_showMediaControls
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
|
||||
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
|
||||
<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>
|
||||
</entry>
|
||||
</group>
|
||||
|
||||
</kcfg>
|
Loading…
Add table
Add a link
Reference in a new issue