mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 10:14:45 +00:00
lockscreen: Use more loaders to improve load times
This commit is contained in:
parent
2deea1b4d0
commit
6a31709897
2 changed files with 46 additions and 32 deletions
|
|
@ -23,7 +23,6 @@ Loader {
|
||||||
|
|
||||||
signal passwordRequested()
|
signal passwordRequested()
|
||||||
|
|
||||||
active: true
|
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
|
|
||||||
sourceComponent: Item {
|
sourceComponent: Item {
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,11 @@ import QtQuick.Layouts 1.1
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
import org.kde.notificationmanager 1.1 as Notifications
|
import org.kde.notificationmanager 1.1 as Notifications
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lockscreen component that is loaded after the device is locked.
|
||||||
|
*
|
||||||
|
* Special attention must be paid to ensuring the GUI loads as fast as possible.
|
||||||
|
*/
|
||||||
PlasmaCore.ColorScope {
|
PlasmaCore.ColorScope {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
|
@ -95,7 +100,7 @@ PlasmaCore.ColorScope {
|
||||||
onPasswordRequested: root.askPassword()
|
onPasswordRequested: root.askPassword()
|
||||||
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: scrollUpIcon.top
|
anchors.bottom: scrollUpIconLoader.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
||||||
|
|
@ -116,7 +121,7 @@ PlasmaCore.ColorScope {
|
||||||
|
|
||||||
anchors.topMargin: headerBar.statusBarHeight
|
anchors.topMargin: headerBar.statusBarHeight
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: scrollUpIcon.top
|
anchors.bottom: scrollUpIconLoader.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
||||||
|
|
@ -125,11 +130,16 @@ PlasmaCore.ColorScope {
|
||||||
}
|
}
|
||||||
|
|
||||||
// scroll up icon
|
// scroll up icon
|
||||||
PlasmaCore.IconItem {
|
Loader {
|
||||||
id: scrollUpIcon
|
id: scrollUpIconLoader
|
||||||
|
asynchronous: true
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.bottomMargin: PlasmaCore.Units.gridUnit + flickable.position * 0.5
|
anchors.bottomMargin: PlasmaCore.Units.gridUnit + flickable.position * 0.5
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
sourceComponent: PlasmaCore.IconItem {
|
||||||
|
id: scrollUpIcon
|
||||||
implicitWidth: PlasmaCore.Units.iconSizes.smallMedium
|
implicitWidth: PlasmaCore.Units.iconSizes.smallMedium
|
||||||
implicitHeight: PlasmaCore.Units.iconSizes.smallMedium
|
implicitHeight: PlasmaCore.Units.iconSizes.smallMedium
|
||||||
opacity: 1 - flickable.openFactor
|
opacity: 1 - flickable.openFactor
|
||||||
|
|
@ -137,14 +147,18 @@ PlasmaCore.ColorScope {
|
||||||
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
||||||
source: "arrow-up"
|
source: "arrow-up"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// password keypad
|
// password keypad
|
||||||
ColumnLayout {
|
Loader {
|
||||||
id: passwordLayout
|
width: parent.width
|
||||||
|
asynchronous: true
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
|
||||||
|
sourceComponent: ColumnLayout {
|
||||||
transform: Translate { y: flickable.keypadHeight - flickable.position }
|
transform: Translate { y: flickable.keypadHeight - flickable.position }
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
spacing: PlasmaCore.Units.gridUnit
|
spacing: PlasmaCore.Units.gridUnit
|
||||||
|
|
||||||
// scroll down icon
|
// scroll down icon
|
||||||
|
|
@ -169,3 +183,4 @@ PlasmaCore.ColorScope {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue