Add scrolling lockscreen, and a darken effect when keypad is shown

This commit is contained in:
Devin Lin 2020-07-11 23:33:54 -04:00 committed by Bhushan Shah
parent e0dd510861
commit 30847f710e

View file

@ -32,21 +32,18 @@ PlasmaCore.ColorScope {
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
anchors.fill: parent anchors.fill: parent
FastBlur { BrightnessContrast {
id: blur id: darken
anchors.fill: parent anchors.fill: parent
source: wallpaper source: wallpaper
radius: 32 brightness: -(passwordFlickable.contentY / passwordFlickable.columnHeight * 0.6)
visible: false
} }
MultiPointTouchArea { FastBlur {
anchors.fill: parent anchors.fill: parent
cached: true
onGestureStarted: { source: darken
numBlock.visible = true radius: passwordFlickable.contentY / passwordFlickable.columnHeight * 32
blur.visible = true
}
} }
DropShadow { DropShadow {
@ -80,10 +77,44 @@ PlasmaCore.ColorScope {
anchors.right: parent.right anchors.right: parent.right
} }
Flickable {
id: passwordFlickable
anchors.fill: parent
property int columnHeight: units.gridUnit * 20
height: columnHeight + root.height
contentHeight: columnHeight + root.height
boundsBehavior: Flickable.StopAtBounds
// always snap to end (either hidden or shown)
onFlickEnded: {
if (!atYBeginning && !atYEnd) {
if (contentY > columnHeight - contentY) {
flick(0, -1000);
} else {
flick(0, 1000);
}
}
// wipe password at beginning
if (atYBeginning) {
}
}
ColumnLayout {
id: passwordLayout
anchors.bottom: parent.bottom
width: parent.width
spacing: units.gridUnit * 2
opacity: Math.sin((Math.PI / 2) * (passwordFlickable.contentY / passwordFlickable.columnHeight) + 1.5 * Math.PI) + 1
Row { Row {
anchors.horizontalCenter: parent.horizontalCenter id: dotDisplay
anchors.bottom: numBlock.top Layout.alignment: Qt.AlignHCenter
anchors.bottomMargin: units.gridUnit * 2
spacing: 6 spacing: 6
Repeater { Repeater {
@ -99,16 +130,14 @@ PlasmaCore.ColorScope {
GridLayout { GridLayout {
id: numBlock id: numBlock
visible: false
property string thePw property string thePw
height: units.gridUnit * 16 Layout.fillWidth: true
anchors.bottom: parent.bottom Layout.minimumHeight: units.gridUnit * 16
anchors.left: parent.left Layout.maximumWidth: root.width
anchors.right: parent.right Layout.bottomMargin: units.gridUnit
anchors.bottomMargin: units.gridUnit Layout.leftMargin: units.gridUnit * 2
anchors.leftMargin: units.gridUnit * 2 Layout.rightMargin: units.gridUnit * 2
anchors.rightMargin: units.gridUnit *2
rowSpacing: units.gridUnit rowSpacing: units.gridUnit
columns: 3 columns: 3
@ -166,3 +195,5 @@ PlasmaCore.ColorScope {
} }
} }
} }
}
}