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
1=== modified file 'libunity-2d-private/src/gesturehandler.cpp'
2--- libunity-2d-private/src/gesturehandler.cpp 2011-11-14 18:40:49 +0000
3+++ libunity-2d-private/src/gesturehandler.cpp 2012-02-10 16:50:50 +0000
4@@ -265,15 +265,6 @@
5 } else if (gestureName == GEIS_GESTURE_TYPE_DRAG4) {
6 m_dragDelta += attributes[GEIS_GESTURE_ATTRIBUTE_DELTA_X].float_val;
7 Q_EMIT dragDeltaChanged();
8- /* If the drag goes sufficiently above than the maximum delta then
9- lock the launcher in place by reserving the area so that no windows
10- overlap it. TODO: move to QML.
11- */
12-// if (m_dragDelta - m_launcher->delta() > 240) {
13-// m_launcher->setUseStrut(true);
14-// } else {
15-// m_launcher->setUseStrut(false);
16-// }
17 }
18 }
19
20
21=== modified file 'shell/Shell.qml'
22--- shell/Shell.qml 2012-02-10 11:17:36 +0000
23+++ shell/Shell.qml 2012-02-10 16:50:50 +0000
24@@ -31,16 +31,39 @@
25
26 Accessible.name: "shell"
27
28+ GestureHandler {
29+ id: gestureHandler
30+ }
31+
32 LauncherLoader {
33 id: launcherLoader
34 anchors.top: parent.top
35 anchors.bottom: parent.bottom
36 width: 65
37+
38+ /* Launcher visibility handling and 4 fingers dragging reveal */
39+ property int hiddenX: Utils.isLeftToRight() ? -width : shell.width
40+ property int shownX: Utils.isLeftToRight() ? 0 : shell.width - width
41 x: {
42- if (Utils.isLeftToRight()) {
43- return visibilityController.shown ? 0 : -width
44- } else {
45- return visibilityController.shown ? shell.width - width : shell.width
46+ var value
47+ var delta = Utils.isLeftToRight() ? gestureHandler.dragDelta : -gestureHandler.dragDelta
48+
49+ if (visibilityController.shown) {
50+ value = shownX
51+ } else {
52+ /* FIXME: it would be better to have gestureHandler disabled
53+ for dragging when hideMode is set to 0 */
54+ if (launcher2dConfiguration.hideMode != 0 && gestureHandler.isDragging) {
55+ value = hiddenX + delta
56+ } else {
57+ value = hiddenX
58+ }
59+ }
60+
61+ if (hiddenX <= shownX) {
62+ return Utils.clamp(value, hiddenX, shownX)
63+ } else {
64+ return Utils.clamp(value, shownX, hiddenX)
65 }
66 }
67
68
69=== modified file 'shell/app/shell.cpp'
70--- shell/app/shell.cpp 2012-02-08 11:05:30 +0000
71+++ shell/app/shell.cpp 2012-02-10 16:50:50 +0000
72@@ -44,7 +44,6 @@
73 #include "shelldeclarativeview.h"
74 #include "dashclient.h"
75 #include "dashdbus.h"
76-#include "gesturehandler.h"
77 #include "launcherdbus.h"
78
79 int main(int argc, char *argv[])

Subscribers

People subscribed via source and target branches