@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013-2014 Canonical, Ltd.
2+ * Copyright (C) 2013-2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -84,6 +84,12 @@ Item {
8484 }
8585 }
8686
87+ function pushEdge(amount) {
88+ if (root.state === "") {
89+ edgeBarrier.push(amount);
90+ }
91+ }
92+
8793 Timer {
8894 id: teaseTimer
8995 interval: mode == "teasing" ? 200 : 300
@@ -96,7 +102,7 @@ Item {
96102 interval: 500
97103 onTriggered: {
98104 if (root.autohideEnabled) {
99− if (!panel.preventHiding && !hoverArea.containsMouse) {
105+ if (!panel.preventHiding) {
100106 root.state = ""
101107 } else {
102108 dismissTimer.restart()
@@ -176,7 +182,6 @@ Item {
176182 root.switchToNextState("visible")
177183 }
178184 }
179−
180185 }
181186
182187 MultiPointTouchArea {
@@ -203,6 +208,28 @@ Item {
203208 Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.BriskDuration } }
204209 }
205210
211+ EdgeBarrier {
212+ id: edgeBarrier
213+ edge: Qt.LeftEdge
214+ target: parent
215+ enabled: root.available
216+ onPassed: { root.switchToNextState("visibleTemporary"); }
217+ material: Component {
218+ Item {
219+ Rectangle {
220+ width: parent.height
221+ height: parent.width
222+ rotation: -90
223+ anchors.centerIn: parent
224+ gradient: Gradient {
225+ GradientStop { position: 0.0; color: panel.color}
226+ GradientStop { position: 1.0; color: Qt.rgba(panel.r,panel.g,panel.b,0)}
227+ }
228+ }
229+ }
230+ }
231+ }
232+
206233 LauncherPanel {
207234 id: panel
208235 objectName: "launcherPanel"
@@ -248,33 +275,6 @@ Item {
248275 }
249276 }
250277
251− // TODO: This should be replaced by some mechanism that reveals the launcher
252− // after a certain resistance has been overcome, like unity7 does. However,
253− // as we don't get relative mouse coordinates yet, this will do for now.
254− MouseArea {
255− id: hoverArea
256− anchors { fill: panel; rightMargin: -1 }
257− hoverEnabled: true
258− propagateComposedEvents: true
259− onContainsMouseChanged: {
260− if (containsMouse) {
261− root.switchToNextState("visibleTemporary");
262− } else {
263− dismissTimer.restart();
264− }
265− }
266− onPressed: mouse.accepted = false;
267−
268− // We need to eat touch events here in order to make sure that
269− // we don't trigger both, the dragArea and the hoverArea
270− MultiPointTouchArea {
271− anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
272− width: units.dp(1)
273− mouseEnabled: false
274− enabled: parent.enabled
275− }
276− }
277−
278278 DirectionalDragArea {
279279 id: dragArea
280280 objectName: "launcherDragArea"
@@ -322,7 +322,6 @@ Item {
322322 target: panel
323323 x: -root.x // so we never go past panelWidth, even when teased by tutorial
324324 }
325− PropertyChanges { target: hoverArea; enabled: false }
326325 },
327326 State {
328327 name: "visibleTemporary"
@@ -331,7 +330,6 @@ Item {
331330 target: root
332331 autohideEnabled: true
333332 }
334− PropertyChanges { target: hoverArea; enabled: true }
335333 },
336334 State {
337335 name: "teasing"