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
|
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
|
||||||
|
|
@ -165,4 +194,6 @@ PlasmaCore.ColorScope {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue