mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
taskswitcher: Fix vertical swipe being overridden by side swipe
This commit is contained in:
parent
afbbe013a5
commit
7b77c9072f
4 changed files with 17 additions and 3 deletions
|
|
@ -25,7 +25,13 @@ Item {
|
|||
|
||||
readonly property real dragOffset: -control.y
|
||||
|
||||
// whether this task is being interacted with
|
||||
readonly property bool interactingActive: control.pressed && control.passedDragThreshold
|
||||
|
||||
// whether to show the text header
|
||||
property bool showHeader: true
|
||||
|
||||
// the amount to darken the task preview by
|
||||
property real darken: 0
|
||||
|
||||
opacity: 1 - dragOffset / taskSwitcher.height
|
||||
|
|
@ -88,7 +94,6 @@ Item {
|
|||
// set threshold
|
||||
if (!passedDragThreshold && Math.abs(y) > dragThreshold) {
|
||||
passedDragThreshold = true;
|
||||
// TODO: request that FlickContainer be not interactive (so we don't change position in list while swiping up)
|
||||
}
|
||||
|
||||
// update position
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ MouseArea {
|
|||
required property var taskSwitcher
|
||||
readonly property var taskSwitcherState: taskSwitcher.taskSwitcherState
|
||||
|
||||
property int taskInteractingCount: 0
|
||||
|
||||
// account for system header and footer offset (center the preview image)
|
||||
readonly property real taskY: {
|
||||
let headerHeight = shellTopMargin;
|
||||
|
|
@ -95,7 +97,6 @@ MouseArea {
|
|||
|
||||
// this is the x-position with respect to the list
|
||||
property real listX: taskSwitcherState.xPositionFromTaskIndex(currentIndex);
|
||||
|
||||
Behavior on listX {
|
||||
NumberAnimation {
|
||||
duration: PlasmaCore.Units.longDuration
|
||||
|
|
@ -120,6 +121,12 @@ MouseArea {
|
|||
return Math.max(0, upperBoundAdjust);
|
||||
}
|
||||
|
||||
// update count of tasks being interacted with, so we know whether we are in a swipe up action
|
||||
onInteractingActiveChanged: {
|
||||
let offset = interactingActive ? 1 : -1;
|
||||
taskInteractingCount = Math.max(0, taskInteractingCount + offset);
|
||||
}
|
||||
|
||||
width: taskSwitcherState.taskWidth
|
||||
height: taskSwitcherState.taskHeight
|
||||
previewWidth: taskSwitcherState.previewWidth
|
||||
|
|
|
|||
|
|
@ -196,6 +196,9 @@ FocusScope {
|
|||
|
||||
taskSwitcherState: root.taskSwitcherState
|
||||
|
||||
// don't allow FlickContainer to steal from swiping on tasks
|
||||
interactive: taskList.taskInteractingCount === 0
|
||||
|
||||
// the item is effectively anchored to the flickable bounds
|
||||
TaskList {
|
||||
id: taskList
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ QtObject {
|
|||
signal unlockFailed()
|
||||
|
||||
function tryPassword() {
|
||||
console.log('try')
|
||||
if (root.password !== '') { // prevent typing lock when password is empty
|
||||
waitingForAuth = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue