mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03: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
|
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
|
property bool showHeader: true
|
||||||
|
|
||||||
|
// the amount to darken the task preview by
|
||||||
property real darken: 0
|
property real darken: 0
|
||||||
|
|
||||||
opacity: 1 - dragOffset / taskSwitcher.height
|
opacity: 1 - dragOffset / taskSwitcher.height
|
||||||
|
|
@ -88,7 +94,6 @@ Item {
|
||||||
// set threshold
|
// set threshold
|
||||||
if (!passedDragThreshold && Math.abs(y) > dragThreshold) {
|
if (!passedDragThreshold && Math.abs(y) > dragThreshold) {
|
||||||
passedDragThreshold = true;
|
passedDragThreshold = true;
|
||||||
// TODO: request that FlickContainer be not interactive (so we don't change position in list while swiping up)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// update position
|
// update position
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ MouseArea {
|
||||||
required property var taskSwitcher
|
required property var taskSwitcher
|
||||||
readonly property var taskSwitcherState: taskSwitcher.taskSwitcherState
|
readonly property var taskSwitcherState: taskSwitcher.taskSwitcherState
|
||||||
|
|
||||||
|
property int taskInteractingCount: 0
|
||||||
|
|
||||||
// account for system header and footer offset (center the preview image)
|
// account for system header and footer offset (center the preview image)
|
||||||
readonly property real taskY: {
|
readonly property real taskY: {
|
||||||
let headerHeight = shellTopMargin;
|
let headerHeight = shellTopMargin;
|
||||||
|
|
@ -95,7 +97,6 @@ MouseArea {
|
||||||
|
|
||||||
// this is the x-position with respect to the list
|
// this is the x-position with respect to the list
|
||||||
property real listX: taskSwitcherState.xPositionFromTaskIndex(currentIndex);
|
property real listX: taskSwitcherState.xPositionFromTaskIndex(currentIndex);
|
||||||
|
|
||||||
Behavior on listX {
|
Behavior on listX {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: PlasmaCore.Units.longDuration
|
duration: PlasmaCore.Units.longDuration
|
||||||
|
|
@ -120,6 +121,12 @@ MouseArea {
|
||||||
return Math.max(0, upperBoundAdjust);
|
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
|
width: taskSwitcherState.taskWidth
|
||||||
height: taskSwitcherState.taskHeight
|
height: taskSwitcherState.taskHeight
|
||||||
previewWidth: taskSwitcherState.previewWidth
|
previewWidth: taskSwitcherState.previewWidth
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,9 @@ FocusScope {
|
||||||
|
|
||||||
taskSwitcherState: root.taskSwitcherState
|
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
|
// the item is effectively anchored to the flickable bounds
|
||||||
TaskList {
|
TaskList {
|
||||||
id: taskList
|
id: taskList
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ QtObject {
|
||||||
signal unlockFailed()
|
signal unlockFailed()
|
||||||
|
|
||||||
function tryPassword() {
|
function tryPassword() {
|
||||||
console.log('try')
|
|
||||||
if (root.password !== '') { // prevent typing lock when password is empty
|
if (root.password !== '') { // prevent typing lock when password is empty
|
||||||
waitingForAuth = true;
|
waitingForAuth = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue