@@ -13,7 +13,7 @@ InputPanel {
id: inputPanel
property bool activated: false
active: activated && Qt.inputMethod.visible
width: parent.width / 3
width: parent.width

states: [
State {
@@ -22,7 +22,6 @@ InputPanel {
PropertyChanges {
target: inputPanel
y: inputPanel.parent.height - inputPanel.height
x: inputPanel.parent.width - inputPanel.width
opacity: 1
visible: true
}
@@ -33,7 +32,6 @@ InputPanel {
PropertyChanges {
target: inputPanel
y: inputPanel.parent.height
x: inputPanel.parent.width - inputPanel.width
opacity: 0
visible:false
}
@@ -1,29 +1,14 @@
/********************************************************************
This file is part of the KDE project.
/*
SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
Copyright (C) 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/

import QtQuick 2.6
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
import QtQuick 2.15
import QtQuick.Layouts 1.15
import Qt5Compat.GraphicalEffects

import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents

import org.kde.plasma.private.sessions 2.0
import "../components"
@@ -33,21 +18,18 @@ Item {
property Item clock
property Item mainStack
property Item footer
property Item formBg
property Item blurArea
property Item blur
property alias source: wallpaperBlur.source
state: lockScreenRoot.uiVisible ? "on" : "off"
property real factor: 0
readonly property bool lightBackground: Math.max(PlasmaCore.ColorScope.backgroundColor.r, PlasmaCore.ColorScope.backgroundColor.g, PlasmaCore.ColorScope.backgroundColor.b) > 0.5
readonly property bool lightColorScheme: Math.max(PlasmaCore.ColorScope.backgroundColor.r, PlasmaCore.ColorScope.backgroundColor.g, PlasmaCore.ColorScope.backgroundColor.b) > 0.5

property bool alwaysShowClock: typeof config === "undefined" || config.alwaysShowClock === true
property bool alwaysShowClock: typeof config === "undefined" || typeof config.alwaysShowClock === "undefined" || config.alwaysShowClock === true

Behavior on factor {
NumberAnimation {
target: wallpaperFader
property: "factor"
duration: 1000
duration: PlasmaCore.Units.veryLongDuration * 2
easing.type: Easing.InOutQuad
}
}
@@ -69,7 +51,7 @@ Item {

readonly property real contrast: 0.65 * wallpaperFader.factor + (1 - wallpaperFader.factor)
readonly property real saturation: 1.6 * wallpaperFader.factor + (1 - wallpaperFader.factor)
readonly property real intensity: (wallpaperFader.lightBackground ? 1.7 : 0.6) * wallpaperFader.factor + (1 - wallpaperFader.factor)
readonly property real intensity: (wallpaperFader.lightColorScheme ? 1.7 : 0.6) * wallpaperFader.factor + (1 - wallpaperFader.factor)

readonly property real transl: (1.0 - contrast) / 2.0;
readonly property real rval: (1.0 - saturation) * 0.2126;
@@ -90,9 +72,8 @@ Item {
0, 0, intensity, 0,
0, 0, 0, 1
));


fragmentShader: "
fragmentShader: `
uniform mediump mat4 colorMatrix;
uniform mediump sampler2D source;
varying mediump vec2 qt_TexCoord0;
@@ -102,7 +83,8 @@ Item {
{
mediump vec4 tex = texture2D(source, qt_TexCoord0);
gl_FragColor = tex * colorMatrix * qt_Opacity;
}"
}
`
}

states: [
@@ -118,7 +100,7 @@ Item {
}
PropertyChanges {
target: wallpaperFader
factor: 0
factor: .3
}
PropertyChanges {
target: clock.shadow
@@ -127,20 +109,6 @@ Item {
PropertyChanges {
target: clock
opacity: 1
anchors.horizontalCenter: formBg.horizontalCenter
// y: parent.height - height - 10
}
PropertyChanges {
target: formBg
opacity: 0.5
}
PropertyChanges {
target: blurArea
opacity: 1
}
PropertyChanges {
target: blur
opacity: 1
}
},
State {
@@ -165,18 +133,6 @@ Item {
target: clock
opacity: wallpaperFader.alwaysShowClock ? 1 : 0
}
PropertyChanges {
target: formBg
opacity: 0
}
PropertyChanges {
target: blurArea
opacity: 0
}
PropertyChanges {
target: blur
opacity: 0
}
}
]
transitions: [
@@ -187,7 +143,7 @@ Item {
NumberAnimation {
targets: [mainStack, footer, clock]
property: "opacity"
duration: units.longDuration
duration: PlasmaCore.Units.veryLongDuration
easing.type: Easing.InOutQuad
}
},
@@ -197,7 +153,7 @@ Item {
NumberAnimation {
targets: [mainStack, footer, clock]
property: "opacity"
duration: 500
duration: PlasmaCore.Units.veryLongDuration
easing.type: Easing.InOutQuad
}
}
@@ -8,11 +8,12 @@ import QtQml 2.15
import QtQuick 2.8
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
import Qt5Compat.GraphicalEffects

import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.workspace.components 2.0 as PW
import org.kde.plasma.plasma5support 2.0 as P5Support

import org.kde.plasma.private.sessions 2.0
import "../components"
@@ -67,17 +68,15 @@ PlasmaCore.ColorScope {
}

function onPrompt(msg) {
lockScreenUi.hadPrompt = true;
root.notification = msg;
mainBlock.echoMode = TextInput.Normal
mainBlock.mainPasswordBox.text = "";
mainBlock.showPassword = true;
mainBlock.mainPasswordBox.forceActiveFocus();
lockScreenUi.hadPrompt = true;
}
function onPromptForSecret(msg) {
lockScreenUi.hadPrompt = true;
mainBlock.echoMode = TextInput.Password
mainBlock.mainPasswordBox.text = "";
mainBlock.showPassword = false;
mainBlock.mainPasswordBox.forceActiveFocus();
lockScreenUi.hadPrompt = true;
}
}

@@ -97,7 +96,7 @@ PlasmaCore.ColorScope {
showNewSessionEntry: false
}

PlasmaCore.DataSource {
P5Support.DataSource {
id: keystateSource
engine: "keystate"
connectedSources: "Caps Lock"
@@ -150,11 +149,13 @@ PlasmaCore.ColorScope {
}
}
Keys.onEscapePressed: {
uiVisible = !uiVisible;
if (inputPanel.keyboardActive) {
inputPanel.showHide();
}
if (!uiVisible) {
// 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();
}
}
@@ -223,19 +224,13 @@ PlasmaCore.ColorScope {
mainStack: mainStack
footer: footer
clock: clock
formBg: formBg
blurArea: blurArea
blur: blur
z: -3
}

DropShadow {
id: clockShadow
anchors.fill: clock
source: clock
visible: false //!softwareRendering
horizontalOffset: 1
verticalOffset: 1
radius: 6
samples: 14
spread: 0.3
@@ -272,11 +267,10 @@ PlasmaCore.ColorScope {
StackView {
id: mainStack
anchors {
//left: parent.left
left: parent.left
right: parent.right
}
height: lockScreenRoot.height + PlasmaCore.Units.gridUnit * 3
width: parent.width / 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
@@ -345,18 +339,6 @@ PlasmaCore.ColorScope {
}
}
visible: sessionsModel.canStartNewSession && sessionsModel.canSwitchUser
},
ActionButton {
text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Button to show/hide virtual keyboard", "Virtual Keyboard")
iconSource: 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
}
]

@@ -392,14 +374,14 @@ PlasmaCore.ColorScope {
state: "hidden"
readonly property bool keyboardActive: item ? item.active : false
anchors {
//left: parent.left
left: parent.left
right: parent.right
}
function showHide() {
state = state == "hidden" ? "visible" : "hidden";
}
Component.onCompleted: {
inputPanel.source = "../components/VirtualKeyboard.qml"
inputPanel.source = "../components/VirtualKeyboard_wayland.qml" : "../components/VirtualKeyboard.qml"
}

onKeyboardActiveChanged: {
@@ -420,8 +402,6 @@ PlasmaCore.ColorScope {
PropertyChanges {
target: inputPanel
y: lockScreenRoot.height - inputPanel.height
x: lockScreenRoot.width - inputPanel.width
opacity: 1
}
},
State {
@@ -433,8 +413,6 @@ PlasmaCore.ColorScope {
PropertyChanges {
target: inputPanel
y: lockScreenRoot.height - lockScreenRoot.height/4
x: lockScreenRoot.width - lockScreenRoot.width/4
opacity: 0
}
}
]
@@ -574,39 +552,6 @@ PlasmaCore.ColorScope {
}
}

Rectangle {
id: formBg
anchors.fill: mainStack
anchors.centerIn: mainStack
color: "#161925"
opacity: 0.4
z:-1
}

ShaderEffectSource {
id: blurArea
sourceItem: wallpaper
width: formBg.width
height: formBg.height
anchors.centerIn: formBg
sourceRect: Qt.rect(x,y,width,height)
visible: true
z:-2
}

GaussianBlur {
id: blur
height: formBg.height
width: formBg.width
source: blurArea
radius: 50
samples: 50 * 2 + 1
cached: true
anchors.centerIn: formBg
visible: true
z:-2
}

Loader {
active: root.viewVisible
source: "LockOsd.qml"
@@ -626,7 +571,7 @@ PlasmaCore.ColorScope {
margins: PlasmaCore.Units.smallSpacing
}

/*PlasmaComponents3.ToolButton {
PlasmaComponents3.ToolButton {
focusPolicy: Qt.TabFocus
text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Button to show/hide virtual keyboard", "Virtual Keyboard")
icon.name: inputPanel.keyboardActive ? "input-keyboard-virtual-on" : "input-keyboard-virtual-off"
@@ -638,7 +583,7 @@ PlasmaCore.ColorScope {
}

visible: inputPanel.status == Loader.Ready
}*/
}

PlasmaComponents3.ToolButton {
focusPolicy: Qt.TabFocus
@@ -6,20 +6,19 @@

import QtQuick 2.2

import QtQuick.Layouts 1.2
import QtQuick.Controls 2.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1

import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.extras 2.0 as PlasmaExtras

import "../components"

SessionManagementScreen {

property Item mainPasswordBox: passwordBox
readonly property alias mainPasswordBox: passwordBox
property bool lockScreenUiVisible: false
property alias echoMode: passwordBox.echoMode
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
@@ -54,17 +53,14 @@ SessionManagementScreen {
RowLayout {
Layout.fillWidth: true

PlasmaComponents3.TextField {
PlasmaExtras.PasswordField {
id: passwordBox
font.pointSize: PlasmaCore.Theme.defaultFont.pointSize + 1
Layout.fillWidth: true

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
@@ -100,45 +96,13 @@ SessionManagementScreen {
}
}

Button {
PlasmaComponents3.Button {
id: loginButton
Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Unlock")
implicitHeight: passwordBox.height - units.smallSpacing * 0.5 // otherwise it comes out taller than the password field
text: ">"
Layout.leftMargin: 30

contentItem: Text {
text: loginButton.text
font: loginButton.font
opacity: enabled ? 1.0 : 0.3
color: "#ffffff"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
Layout.preferredHeight: passwordBox.implicitHeight
Layout.preferredWidth: loginButton.Layout.preferredHeight

background: Rectangle {
id: buttonBorder
width: 30
height: 40
//radius: width / 2
rotation: -90
anchors.centerIn: parent

gradient: Gradient {
GradientStop { position: 0.0; color: "#75b9e7" }
GradientStop { position: 1.0; color: "#3498db" }
}
}

Rectangle {
id: buttonBackground
height: 28
width: 38
//radius: height / 2
anchors.centerIn: buttonBorder
color: "#75b9e7"
}
icon.name: LayoutMirroring.enabled ? "go-previous" : "go-next"

onClicked: startLogin()
Keys.onEnterPressed: clicked()
@@ -6,10 +6,12 @@

import QtQuick 2.5
import QtQuick.Layouts 1.1
import QtQuick.Window 2.15

import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.plasma5support 2.0 as P5Support

Item {
visible: mpris2Source.hasPlayer
@@ -23,14 +25,14 @@ Item {

enabled: mpris2Source.canControl

PlasmaCore.DataSource {
P5Support.DataSource {
id: mpris2Source

readonly property string source: "@multiplex"
readonly property var playerData: data[source]

readonly property bool hasPlayer: sources.length > 1 && !!playerData
readonly property string identity: hasPlayer ? playerData.Identity : ""
readonly property string identity: hasPlayer && playerData.Identity || ""
readonly property bool playing: hasPlayer && playerData.PlaybackStatus === "Playing"
readonly property bool canControl: hasPlayer && playerData.CanControl
readonly property bool canGoBack: hasPlayer && playerData.CanGoPrevious
@@ -55,7 +57,8 @@ Item {
const lastUrlPart = xesamUrl.substring(lastSlashPos + 1)
return decodeURIComponent(lastUrlPart)
}
readonly property string artist: currentMetadata["xesam:artist"] || ""
readonly property var artists: currentMetadata["xesam:artist"] || [] // stringlist
readonly property var albumArtists: currentMetadata["xesam:albumArtist"] || [] // stringlist
readonly property string albumArt: currentMetadata["mpris:artUrl"] || ""

engine: "mpris2"
@@ -85,7 +88,7 @@ Item {
asynchronous: true
fillMode: Image.PreserveAspectFit
source: mpris2Source.albumArt
sourceSize.height: height
sourceSize.height: height * Screen.devicePixelRatio
visible: status === Image.Loading || status === Image.Ready
}

@@ -117,7 +120,7 @@ Item {
wrapMode: Text.NoWrap
elide: Text.ElideRight
// if no artist is given, show player name instead
text: mpris2Source.artist || mpris2Source.identity || ""
text: mpris2Source.artists.length > 0 ? mpris2Source.artists.join(", ") : (mpris2Source.albumArtists.length > 0 ? mpris2Source.albumArtists.join(", ") : mpris2Source.identity)
textFormat: Text.PlainText
font.pointSize: PlasmaCore.Theme.smallestFont.pointSize + 1
maximumLineCount: 1