2
* Copyright (C) 2013 Canonical, Ltd.
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.
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.
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/>.
18
import Ubuntu.Gestures 0.1
19
import Ubuntu.Components 0.1
24
function reset() { launcher.x = root.width }
34
function followDragArea() {
35
if (dragArea.status === DirectionalDragArea.Rejected)
38
return dragArea.distance > -width ?
39
root.width + dragArea.distance
48
anchors.fill: dragArea
53
objectName: "hnDragArea"
57
direction: DirectionalDragArea.Leftwards
58
maxDeviation: units.gu(2)
60
distanceThreshold: units.gu(4)
64
case DirectionalDragArea.WaitingForTouch:
65
dragAreaRect.opacity = 0.0
67
case DirectionalDragArea.Undecided:
68
dragAreaRect.color = "yellow"
69
dragAreaRect.opacity = 0.3
70
launcher.x = Qt.binding(launcher.followDragArea)
72
case DirectionalDragArea.Recognized:
73
dragAreaRect.color = "green"
74
dragAreaRect.opacity = 0.5
76
default: //case DirectionalDragArea.Rejected:
77
dragAreaRect.color = "red"
78
dragAreaRect.opacity = 0.5
79
launcher.x = -launcher.height