mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 10:14:45 +00:00
Add scrolling lockscreen, and a darken effect when keypad is shown
This commit is contained in:
parent
e0dd510861
commit
30847f710e
1 changed files with 116 additions and 85 deletions
|
|
@ -32,21 +32,18 @@ PlasmaCore.ColorScope {
|
|||
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
||||
anchors.fill: parent
|
||||
|
||||
FastBlur {
|
||||
id: blur
|
||||
BrightnessContrast {
|
||||
id: darken
|
||||
anchors.fill: parent
|
||||
source: wallpaper
|
||||
radius: 32
|
||||
visible: false
|
||||
brightness: -(passwordFlickable.contentY / passwordFlickable.columnHeight * 0.6)
|
||||
}
|
||||
|
||||
MultiPointTouchArea {
|
||||
FastBlur {
|
||||
anchors.fill: parent
|
||||
|
||||
onGestureStarted: {
|
||||
numBlock.visible = true
|
||||
blur.visible = true
|
||||
}
|
||||
cached: true
|
||||
source: darken
|
||||
radius: passwordFlickable.contentY / passwordFlickable.columnHeight * 32
|
||||
}
|
||||
|
||||
DropShadow {
|
||||
|
|
@ -80,10 +77,44 @@ PlasmaCore.ColorScope {
|
|||
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 {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: numBlock.top
|
||||
anchors.bottomMargin: units.gridUnit * 2
|
||||
id: dotDisplay
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
spacing: 6
|
||||
|
||||
Repeater {
|
||||
|
|
@ -99,16 +130,14 @@ PlasmaCore.ColorScope {
|
|||
|
||||
GridLayout {
|
||||
id: numBlock
|
||||
visible: false
|
||||
property string thePw
|
||||
|
||||
height: units.gridUnit * 16
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottomMargin: units.gridUnit
|
||||
anchors.leftMargin: units.gridUnit * 2
|
||||
anchors.rightMargin: units.gridUnit *2
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumHeight: units.gridUnit * 16
|
||||
Layout.maximumWidth: root.width
|
||||
Layout.bottomMargin: units.gridUnit
|
||||
Layout.leftMargin: units.gridUnit * 2
|
||||
Layout.rightMargin: units.gridUnit * 2
|
||||
rowSpacing: units.gridUnit
|
||||
|
||||
columns: 3
|
||||
|
|
@ -166,3 +195,5 @@ PlasmaCore.ColorScope {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue