mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-28 22:53:09 +00:00
homescreen: Adjust swipe threshold to be more lenient for horizontal swipes
This commit is contained in:
parent
29bbb1a178
commit
f849a5fea5
1 changed files with 7 additions and 6 deletions
|
|
@ -96,7 +96,8 @@ QtObject {
|
|||
property var currentSwipeState: HomeScreenState.DeterminingType
|
||||
|
||||
// threshold of movement in a direction before we count that as the defining SwipeState
|
||||
readonly property real swipeStateDetermineThreshold: PlasmaCore.Units.smallSpacing
|
||||
readonly property real horizontalSwipeStateDetermineThreshold: PlasmaCore.Units.smallSpacing
|
||||
readonly property real verticalSwipeStateDetermineThreshold: PlasmaCore.Units.smallSpacing * 3
|
||||
|
||||
// we put the offset position here when determining the swipe type, before we
|
||||
// transfer movement over to xPosition and yPosition
|
||||
|
|
@ -185,16 +186,16 @@ QtObject {
|
|||
yDetermineSwipePosition += y;
|
||||
|
||||
// check if a swipetype can be determined and started
|
||||
if (Math.abs(xDetermineSwipePosition) >= swipeStateDetermineThreshold) {
|
||||
if (Math.abs(xDetermineSwipePosition) >= horizontalSwipeStateDetermineThreshold) {
|
||||
currentSwipeState = HomeScreenState.SwipingPages;
|
||||
xDetermineSwipePosition = 0;
|
||||
yDetermineSwipePosition = 0;
|
||||
} else if (yDetermineSwipePosition >= swipeStateDetermineThreshold) {
|
||||
} else if (yDetermineSwipePosition >= verticalSwipeStateDetermineThreshold) {
|
||||
currentSwipeState = HomeScreenState.SwipingActionPanel;
|
||||
MobileShell.TopPanelControls.startSwipe();
|
||||
xDetermineSwipePosition = 0;
|
||||
yDetermineSwipePosition = 0;
|
||||
} else if (-yDetermineSwipePosition >= swipeStateDetermineThreshold) {
|
||||
} else if (-yDetermineSwipePosition >= verticalSwipeStateDetermineThreshold) {
|
||||
currentSwipeState = HomeScreenState.SwipingAppDrawerVisibility;
|
||||
xDetermineSwipePosition = 0;
|
||||
yDetermineSwipePosition = 0;
|
||||
|
|
@ -226,11 +227,11 @@ QtObject {
|
|||
yDetermineSwipePosition += y;
|
||||
|
||||
// check if a swipetype can be determined and started
|
||||
if (yDetermineSwipePosition >= swipeStateDetermineThreshold) {
|
||||
if (yDetermineSwipePosition >= verticalSwipeStateDetermineThreshold) {
|
||||
currentSwipeState = HomeScreenState.SwipingAppDrawerVisibility;
|
||||
xDetermineSwipePosition = 0;
|
||||
yDetermineSwipePosition = 0;
|
||||
} else if (-yDetermineSwipePosition >= swipeStateDetermineThreshold) {
|
||||
} else if (-yDetermineSwipePosition >= verticalSwipeStateDetermineThreshold) {
|
||||
currentSwipeState = HomeScreenState.SwipingAppDrawerList;
|
||||
yVelocityCalculator.startMeasure(appDrawerFlickable.contentY);
|
||||
xDetermineSwipePosition = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue