Merge lp:~fboucault/unity-2d/shell_gestures into lp:~unity-2d-team/unity-2d/unity-2d-shell

Proposed by Florian Boucault
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 1007
Merged at revision: 1005
Proposed branch: lp:~fboucault/unity-2d/shell_gestures
Merge into: lp:~unity-2d-team/unity-2d/unity-2d-shell
Diff against target: 79 lines (+27/-14)
3 files modified
libunity-2d-private/src/gesturehandler.cpp (+0/-9)
shell/Shell.qml (+27/-4)
shell/app/shell.cpp (+0/-1)
To merge this branch: bzr merge lp:~fboucault/unity-2d/shell_gestures
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
Review via email: mp+92515@code.launchpad.net

Description of the change

Reactivated gesture handling:
- 4 fingers tap to toggle the dash
- 3 fingers pinch to zoom in/out of the spread
- 4 fingers drag to reveal/dismiss the launcher

Missing feature:
When revealing the launcher by dragging, the launcher should lock in place if dragged further than it's shown position. By lock in place, we mean that its hideMode should be set to 0.

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote :

Looks acceptable with the known shortcomings, can't really test more since don't have the hardware available

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libunity-2d-private/src/gesturehandler.cpp'
--- libunity-2d-private/src/gesturehandler.cpp 2011-11-14 18:40:49 +0000
+++ libunity-2d-private/src/gesturehandler.cpp 2012-02-10 16:50:50 +0000
@@ -265,15 +265,6 @@
265 } else if (gestureName == GEIS_GESTURE_TYPE_DRAG4) {265 } else if (gestureName == GEIS_GESTURE_TYPE_DRAG4) {
266 m_dragDelta += attributes[GEIS_GESTURE_ATTRIBUTE_DELTA_X].float_val;266 m_dragDelta += attributes[GEIS_GESTURE_ATTRIBUTE_DELTA_X].float_val;
267 Q_EMIT dragDeltaChanged();267 Q_EMIT dragDeltaChanged();
268 /* If the drag goes sufficiently above than the maximum delta then
269 lock the launcher in place by reserving the area so that no windows
270 overlap it. TODO: move to QML.
271 */
272// if (m_dragDelta - m_launcher->delta() > 240) {
273// m_launcher->setUseStrut(true);
274// } else {
275// m_launcher->setUseStrut(false);
276// }
277 }268 }
278}269}
279270
280271
=== modified file 'shell/Shell.qml'
--- shell/Shell.qml 2012-02-10 11:17:36 +0000
+++ shell/Shell.qml 2012-02-10 16:50:50 +0000
@@ -31,16 +31,39 @@
3131
32 Accessible.name: "shell"32 Accessible.name: "shell"
3333
34 GestureHandler {
35 id: gestureHandler
36 }
37
34 LauncherLoader {38 LauncherLoader {
35 id: launcherLoader39 id: launcherLoader
36 anchors.top: parent.top40 anchors.top: parent.top
37 anchors.bottom: parent.bottom41 anchors.bottom: parent.bottom
38 width: 6542 width: 65
43
44 /* Launcher visibility handling and 4 fingers dragging reveal */
45 property int hiddenX: Utils.isLeftToRight() ? -width : shell.width
46 property int shownX: Utils.isLeftToRight() ? 0 : shell.width - width
39 x: {47 x: {
40 if (Utils.isLeftToRight()) {48 var value
41 return visibilityController.shown ? 0 : -width49 var delta = Utils.isLeftToRight() ? gestureHandler.dragDelta : -gestureHandler.dragDelta
42 } else {50
43 return visibilityController.shown ? shell.width - width : shell.width51 if (visibilityController.shown) {
52 value = shownX
53 } else {
54 /* FIXME: it would be better to have gestureHandler disabled
55 for dragging when hideMode is set to 0 */
56 if (launcher2dConfiguration.hideMode != 0 && gestureHandler.isDragging) {
57 value = hiddenX + delta
58 } else {
59 value = hiddenX
60 }
61 }
62
63 if (hiddenX <= shownX) {
64 return Utils.clamp(value, hiddenX, shownX)
65 } else {
66 return Utils.clamp(value, shownX, hiddenX)
44 }67 }
45 }68 }
4669
4770
=== modified file 'shell/app/shell.cpp'
--- shell/app/shell.cpp 2012-02-08 11:05:30 +0000
+++ shell/app/shell.cpp 2012-02-10 16:50:50 +0000
@@ -44,7 +44,6 @@
44#include "shelldeclarativeview.h"44#include "shelldeclarativeview.h"
45#include "dashclient.h"45#include "dashclient.h"
46#include "dashdbus.h"46#include "dashdbus.h"
47#include "gesturehandler.h"
48#include "launcherdbus.h"47#include "launcherdbus.h"
4948
50int main(int argc, char *argv[])49int main(int argc, char *argv[])

Subscribers

People subscribed via source and target branches