add basic UI indication of task scrub mode being active

includes a UI hint of what to do
This commit is contained in:
Luis Büchi 2024-05-13 18:39:43 +02:00 committed by Devin Lin
parent 29656981bb
commit 39a3625329
2 changed files with 44 additions and 1 deletions

View file

@ -430,6 +430,49 @@ FocusScope {
}
}
RowLayout {
id: scrubIndicator
opacity: taskSwitcherHelpers.isInTaskScrubMode ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 200} }
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottomMargin: taskSwitcherHelpers.openedYPosition * 3 / 4
Kirigami.Icon {
id: iconScrubBack
opacity: root.state.currentTaskIndex == 0 ? 0.3 : 1
Behavior on opacity { NumberAnimation { duration: 200} }
Layout.alignment: Qt.AlignHCenter
implicitWidth: Kirigami.Units.iconSizes.small
implicitHeight: Kirigami.Units.iconSizes.small
source: "draw-arrow-back"
color: "white"
}
Kirigami.Heading {
Layout.fillWidth: true
Layout.maximumWidth: root.width * 0.75
Layout.alignment: Qt.AlignHCenter
color: "white"
level: 3
wrapMode: Text.Wrap
horizontalAlignment: Text.AlignHCenter
text: i18n("Swipe")
}
Kirigami.Icon {
id: iconScrubFront
opacity: root.state.currentTaskIndex == tasksCount - 1 ? 0.3 : 1
Behavior on opacity { NumberAnimation { duration: 200} }
Layout.alignment: Qt.AlignHCenter
implicitWidth: Kirigami.Units.iconSizes.small
implicitHeight: Kirigami.Units.iconSizes.small
source: "draw-arrow-forward"
color: "white"
}
}
// flicking area for task switcher
FlickContainer {
id: flickable

View file

@ -31,7 +31,7 @@ QtObject {
readonly property real openedYPosition: (taskSwitcher.height - taskHeight) / 2
// yPosition threshold below which opening the task switcher should be undone and returned to the previously active task
readonly property real undoYThreshold: openedYPosition / 3
readonly property real undoYThreshold: openedYPosition / 2
// ~~ measurement constants ~~