on xenial help sign in
Added vertical velocity detector to guard accidental indicator left to right swipes.
bf91bc9Nick Dedekind
Panel/Indicators.qml+15
@@ -97,6 +97,14 @@ Showable {
97 MathLocal.clamp((indicators.height - handle.height - hintValue) /
97 MathLocal.clamp((indicators.height - handle.height - hintValue) /
98 (lockThreshold - hintValue), 0, 1);
98 (lockThreshold - hintValue), 0, 1);
99
99
100+ /*
101+ Vertical velocity check. Don't change the indicator if we're moving too quickly.
102+ */
103+ var verticalVelocity = Math.abs(yVelocityCalculator.calculate());
104+ if (verticalVelocity >= 0.3 && indicatorRow.currentItem!=null) {
105+ return;
106+ }
107+
100 /*
108 /*
101 Percentage of an indicator icon's width the user's press can stray horizontally from the
109 Percentage of an indicator icon's width the user's press can stray horizontally from the
102 focused icon before we change focus to another icon. E.g. a value of 0.5 means you must
110 focused icon before we change focus to another icon. E.g. a value of 0.5 means you must
@@ -282,6 +290,9 @@ Showable {
282 var buffer = dragHandle.dragging ? true : false;
290 var buffer = dragHandle.dragging ? true : false;
283 indicators.calculateCurrentItem(dragHandle.touchX, buffer);
291 indicators.calculateCurrentItem(dragHandle.touchX, buffer);
284 }
292 }
293+ onTouchSceneYChanged: {
294+ yVelocityCalculator.trackedPosition = dragHandle.touchSceneY;
295+ }
285 }
296 }
286
297
287 DragHandle {
298 DragHandle {
@@ -325,6 +336,10 @@ Showable {
325 }
336 }
326 }
337 }
327
338
339+ AxisVelocityCalculator {
340+ id: yVelocityCalculator
341+ }
342+
328 states: [
343 states: [
329 State {
344 State {
330 name: "initial"
345 name: "initial"