on xenial help sign in
review comments
966e2f9Nick Dedekind
qml/Components/ListItems/VerticalThinDivider.qmldeleted−26
@@ -1,26 +0,0 @@
1−/*
2− * Copyright (C) 2012 Canonical, Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
12− *
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−import QtQuick 2.0
18−
19−Image {
20− anchors {
21− top: (parent) ? parent.top : null
22− bottom: (parent) ? parent.bottom : null
23− }
24− width: (visible) ? units.dp(2) : 0
25− source: "graphics/ListItemDividerVertical.png"
26−}
qml/Components/ListItems/graphics/ListItemDividerVertical@18.pngdeleted

Binary file not shown.

qml/Panel/IndicatorItemRow.qml+7−3
@@ -35,11 +35,15 @@ Item {
35
35
36 property real lateralPosition: -1
36 property real lateralPosition: -1
37 onLateralPositionChanged: {
37 onLateralPositionChanged: {
38− if (currentItem && !enableLateralChanges) return;
38+ updateItemFromLateralPosition();
39+ }
40+
41+ onEnableLateralChangesChanged: {
39− updateItemFromLateralPosition(lateralPosition);
42+ updateItemFromLateralPosition();
40 }
43 }
41
44
42− function updateItemFromLateralPosition(lateralPosition) {
45+ function updateItemFromLateralPosition() {
46+ if (currentItem && !enableLateralChanges) return;
43 if (lateralPosition === -1) return;
47 if (lateralPosition === -1) return;
44
48
45 if (!currentItem) {
49 if (!currentItem) {
qml/Panel/IndicatorsBar.qml−7
@@ -36,13 +36,6 @@ Item {
36 row.selectItemAt(mapped.x);
36 row.selectItemAt(mapped.x);
37 }
37 }
38
38
39− function updateItemFromLateralPosition(position) {
40− if (position === -1) return;
41−
42− var mapped = root.mapToItem(row, position, 0);
43− row.updateItemFromLateralPosition(mapped.x);
44− }
45−
46 function setCurrentItemIndex(index) {
39 function setCurrentItemIndex(index) {
47 if (!expanded) {
40 if (!expanded) {
48 row.resetCurrentItem();
41 row.resetCurrentItem();
qml/Panel/IndicatorsMenu.qml+2−13
@@ -200,8 +200,6 @@ Showable {
200 id: yVelocityCalculator
200 id: yVelocityCalculator
201 velocityThreshold: 0.5
201 velocityThreshold: 0.5
202 trackedValue: d.activeDragHandle ? d.activeDragHandle.touchSceneY : 0
202 trackedValue: d.activeDragHandle ? d.activeDragHandle.touchSceneY : 0
203−
204− onVelocityThresholdTriggered: bar.updateItemFromLateralPosition(bar.lateralPosition);
205 }
203 }
206
204
207 Connections {
205 Connections {
@@ -256,7 +254,6 @@ Showable {
256
254
257 property real rowMappedLateralPosition: {
255 property real rowMappedLateralPosition: {
258 if (!d.activeDragHandle) return -1;
256 if (!d.activeDragHandle) return -1;
259− if (!d.activeDragHandle.dragging) return -1;
260 return d.activeDragHandle.mapToItem(bar, d.activeDragHandle.touchX, 0).x;
257 return d.activeDragHandle.mapToItem(bar, d.activeDragHandle.touchX, 0).x;
261 }
258 }
262 }
259 }
@@ -280,20 +277,14 @@ Showable {
280 // changes to lateral touch position effect which indicator is selected
277 // changes to lateral touch position effect which indicator is selected
281 lateralPosition: d.rowMappedLateralPosition
278 lateralPosition: d.rowMappedLateralPosition
282 // vertical velocity determines if changes in lateral position has an effect
279 // vertical velocity determines if changes in lateral position has an effect
283− enableLateralChanges: {
280+ enableLateralChanges: d.activeDragHandle &&
284− if (!d.activeDragHandle) return false;
285− if (!d.activeDragHandle.dragging) return false;
286−
287− return !yVelocityCalculator.stopLateralChanges;
281+ !yVelocityCalculator.velocityAboveThreshold
288− }
289 }
282 }
290 // left scroll bar handling
283 // left scroll bar handling
291 PropertyChanges {
284 PropertyChanges {
292 target: leftScroller
285 target: leftScroller
293 lateralPosition: {
286 lateralPosition: {
294 if (!d.activeDragHandle) return -1;
287 if (!d.activeDragHandle) return -1;
295− if (!d.activeDragHandle.dragging) return -1;
296−
297 var mapped = d.activeDragHandle.mapToItem(leftScroller, d.activeDragHandle.touchX, 0);
288 var mapped = d.activeDragHandle.mapToItem(leftScroller, d.activeDragHandle.touchX, 0);
298 return mapped.x;
289 return mapped.x;
299 }
290 }
@@ -303,8 +294,6 @@ Showable {
303 target: rightScroller
294 target: rightScroller
304 lateralPosition: {
295 lateralPosition: {
305 if (!d.activeDragHandle) return -1;
296 if (!d.activeDragHandle) return -1;
306− if (!d.activeDragHandle.dragging) return -1;
307−
308 var mapped = d.activeDragHandle.mapToItem(rightScroller, d.activeDragHandle.touchX, 0);
297 var mapped = d.activeDragHandle.mapToItem(rightScroller, d.activeDragHandle.touchX, 0);
309 return mapped.x;
298 return mapped.x;
310 }
299 }
qml/Panel/Panel.qml+1−5
@@ -18,7 +18,6 @@ import QtQuick 2.2
18import Ubuntu.Components 1.1
18import Ubuntu.Components 1.1
19import Unity.Application 0.1
19import Unity.Application 0.1
20import "../Components"
20import "../Components"
21−import "../Components/ListItems"
22import ".."
21import ".."
23
22
24Item {
23Item {
@@ -92,16 +91,13 @@ Item {
92 saturation: 1 - indicators.unitProgress
91 saturation: 1 - indicators.unitProgress
93 }
92 }
94
93
95− VerticalThinDivider {
94+ Image {
96− id: indicatorDividor
97 anchors {
95 anchors {
98 top: indicators.top
96 top: indicators.top
99 bottom: indicators.bottom
97 bottom: indicators.bottom
100 right: indicators.left
98 right: indicators.left
101−
102 topMargin: indicatorArea.anchors.topMargin + indicators.minimizedPanelHeight
99 topMargin: indicatorArea.anchors.topMargin + indicators.minimizedPanelHeight
103 }
100 }
104−
105 width: units.dp(2)
101 width: units.dp(2)
106 source: "graphics/VerticalDivider.png"
102 source: "graphics/VerticalDivider.png"
107 }
103 }
qml/Panel/PanelVelocityCalculator.qml+5−8
@@ -20,28 +20,25 @@ import Ubuntu.Gestures 0.1
20Item {
20Item {
21 id: root
21 id: root
22 property real trackedValue: 0
22 property real trackedValue: 0
23− property bool stopLateralChanges: false
23+ property bool velocityAboveThreshold: false
24 property real velocityThreshold: 0.4
24 property real velocityThreshold: 0.4
25
25
26− signal velocityThresholdTriggered
27−
28 function reset() {
26 function reset() {
29 velocityTimer.stop();
27 velocityTimer.stop();
30− stopLateralChanges = false;
28+ velocityAboveThreshold = false;
31 calc.reset();
29 calc.reset();
32 }
30 }
33
31
34 function update() {
32 function update() {
35− var previouslyStopped = stopLateralChanges;
33+ var previouslyStopped = velocityAboveThreshold;
36
34
37 calc.trackedPosition = trackedValue;
35 calc.trackedPosition = trackedValue;
38− stopLateralChanges = Math.abs(calc.calculate()) > velocityThreshold;
36+ velocityAboveThreshold = Math.abs(calc.calculate()) > velocityThreshold;
39
37
40− if (stopLateralChanges) { // only start timer if we're above the threshold.
38+ if (velocityAboveThreshold) { // only start timer if we're above the threshold.
41 velocityTimer.start();
39 velocityTimer.start();
42 } else if (previouslyStopped) { // if we have previously been stopped, then trigger the signal
40 } else if (previouslyStopped) { // if we have previously been stopped, then trigger the signal
43 velocityTimer.stop();
41 velocityTimer.stop();
44− velocityThresholdTriggered();
45 }
42 }
46 }
43 }
47
44