mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
lockscreen: Animate keypad header to center when switching to keyboard

This commit is contained in:
parent
d122665eb5
commit
8b5b728939
1 changed files with 63 additions and 2 deletions
|
|
@ -32,8 +32,41 @@ Item {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
spacing: Kirigami.Units.gridUnit * 2
|
spacing: Kirigami.Units.gridUnit * 2
|
||||||
|
|
||||||
LayoutItemProxy { target: header }
|
LayoutItemProxy {
|
||||||
|
id: verticalHeaderProxy
|
||||||
|
target: header
|
||||||
|
}
|
||||||
LayoutItemProxy { target: keypadGrid }
|
LayoutItemProxy { target: keypadGrid }
|
||||||
|
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "keypad"
|
||||||
|
when: !lockScreenState.isKeyboardMode
|
||||||
|
AnchorChanges {
|
||||||
|
target: verticalHeaderProxy; anchors.top: keypadVerticalContainer.top
|
||||||
|
}
|
||||||
|
PropertyChanges {
|
||||||
|
target: verticalHeaderProxy; anchors.verticalCenterOffset: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "keyboard"
|
||||||
|
when: lockScreenState.isKeyboardMode
|
||||||
|
AnchorChanges {
|
||||||
|
target: verticalHeaderProxy; anchors.verticalCenter: keypadVerticalContainer.verticalCenter
|
||||||
|
}
|
||||||
|
PropertyChanges {
|
||||||
|
target: verticalHeaderProxy; anchors.verticalCenterOffset: -Kirigami.Units.gridUnit * 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
transitions: Transition {
|
||||||
|
AnchorAnimation {
|
||||||
|
easing.type: Easing.OutCirc
|
||||||
|
duration: openProgress > 0.5 ? 300 : 0
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Row layout - used when there is restricted height
|
// Row layout - used when there is restricted height
|
||||||
|
|
@ -44,8 +77,35 @@ Item {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
spacing: Kirigami.Units.gridUnit * 2
|
spacing: Kirigami.Units.gridUnit * 2
|
||||||
|
|
||||||
LayoutItemProxy { target: header }
|
LayoutItemProxy {
|
||||||
|
id: horizontalHeaderProxy
|
||||||
|
target: header
|
||||||
|
}
|
||||||
LayoutItemProxy { target: keypadGrid }
|
LayoutItemProxy { target: keypadGrid }
|
||||||
|
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "keypad"
|
||||||
|
when: !lockScreenState.isKeyboardMode
|
||||||
|
AnchorChanges {
|
||||||
|
target: horizontalHeaderProxy; anchors.left: keypadHorizontalContainer.left
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "keyboard"
|
||||||
|
when: lockScreenState.isKeyboardMode
|
||||||
|
AnchorChanges {
|
||||||
|
target: horizontalHeaderProxy; anchors.horizontalCenter: keypadHorizontalContainer.horizontalCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
transitions: Transition {
|
||||||
|
AnchorAnimation {
|
||||||
|
easing.type: Easing.OutCirc
|
||||||
|
duration: openProgress > 0.5 ? 300 : 0
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
|
@ -78,6 +138,7 @@ Item {
|
||||||
|
|
||||||
lockScreenState: root.lockScreenState
|
lockScreenState: root.lockScreenState
|
||||||
isKeypadOpen: root.openProgress >= 0.9
|
isKeypadOpen: root.openProgress >= 0.9
|
||||||
|
enabled: root.openProgress >= 0.8
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue