Merge lp:~tiagosh/unity-2d/bugfix-891565 into lp:unity-2d

Proposed by Tiago Salem Herrmann
Status: Rejected
Rejected by: Albert Astals Cid
Proposed branch: lp:~tiagosh/unity-2d/bugfix-891565
Merge into: lp:unity-2d
Diff against target: 108 lines (+74/-0)
2 files modified
places/LensBar.qml (+61/-0)
places/dash.qml (+13/-0)
To merge this branch: bzr merge lp:~tiagosh/unity-2d/bugfix-891565
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Disapprove
PS Jenkins bot (community) continuous-integration Needs Fixing
jenkins (community) continuous-integration Disapprove
Lohith D Shivamurthy (community) Needs Fixing
Review via email: mp+83154@code.launchpad.net

This proposal supersedes a proposal from 2011-11-22.

Description of the change

Implement lenses switching in dash by pressing CTRL+TAB, CTRL+SHIFT+TAB, CTRL+PGUP and CTRL+PGDOWN

To post a comment you must log in.
Revision history for this message
MichaƂ Sawicz (saviq) wrote : Posted in a previous version of this proposal

Typos on lines 31 and 54 of the diff.

Also, please link to a bug from design, or assign one to ayatana-design, to get feedback on whether the navigation should wrap or not. In other instances, they explicitly said to disable wrapping, not sure it should be different here.

Revision history for this message
Gerry Boland (gerboland) wrote :

Until we get automated testing going, I need to ask you to write unit tests to test this fix, and place them in https://wiki.ubuntu.com/Unity2DRegressionTests

Please note that some may already be in https://wiki.ubuntu.com/UnityTests so you don't need to repeat them.

Revision history for this message
Lohith D Shivamurthy (dyams) wrote :

Hey, Bug description says that TAB key should be supported. Would you add TAB key suport too? Please.

review: Needs Fixing
Revision history for this message
Gerry Boland (gerboland) wrote :

Hey Tiago,
I was keeping this MR aside as I found the code pretty huge for such a featurette. Now with the Home lens soon being an actual lens, it may simplify this a lit. So let's sit on this a little longer?
Thanks
-Gerry

Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

Yes, I believe it is better to wait for the home lens to be integrated. It will make things easier.
Besides that, this MR doesn't implement everything that was requested in that bug report.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Doesn't apply cleanly to lp:unity-2d anymore

review: Needs Fixing
Revision history for this message
jenkins (martin-mrazik+qa) wrote :

FAILED: Continuous integration, rev:792
http://s-jenkins:8080/job/unity-2d-ci/10/

review: Disapprove (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Cleaning up my review request queue[1], i guess noone cares if i reject this, right?

[1] https://code.launchpad.net/~aacid/+activereviews

review: Disapprove

Unmerged revisions

792. By Tiago Salem Herrmann

[places] cleanup legacy code

791. By Tiago Salem Herrmann

[places] move tab key handling code to dash.qml in order to make it work globally

790. By Tiago Salem Herrmann

[places] fix typo on comments

789. By Tiago Salem Herrmann

[places] add backtab handling for lenses switching

788. By Tiago Salem Herrmann

[places] make tab key switch between lenses

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'places/LensBar.qml'
2--- places/LensBar.qml 2011-11-14 10:45:33 +0000
3+++ places/LensBar.qml 2011-11-23 13:00:17 +0000
4@@ -34,6 +34,14 @@
5 filterRegExp: RegExp("^true$")
6 }
7
8+ function activateNext(currentLensId) {
9+ lensContainer.activateNext(currentLensId)
10+ }
11+
12+ function activatePrevious(currentLensId) {
13+ lensContainer.activatePrevious(currentLensId)
14+ }
15+
16 Rectangle {
17 id: background
18
19@@ -93,6 +101,57 @@
20 return undefined
21 }
22
23+ function activateNext(currentLensId) {
24+ /* as Repeater is also a child, we have to decrease 2 */
25+ var numberOfChildren = children.length-2
26+ for(var i=0; i<children.length; i++) {
27+ if (children[i] != repeater) {
28+ var child = children[i]
29+ /* currentLensId for home is empty */
30+ if (child.lensId == currentLensId || currentLensId == "") {
31+ /* make sure this isn't the last icon, and if so go back to home */
32+ if (i < numberOfChildren) {
33+ var childNext = children[i+1]
34+ dash.activateLens(childNext.lensId)
35+ return
36+ } else {
37+ dash.activateHome()
38+ return
39+ }
40+ }
41+ }
42+ }
43+ }
44+
45+ function activatePrevious(currentLensId) {
46+ /* as Repeater is also a child, we have to decrease 2 */
47+ var numberOfChildren = children.length-2
48+ var visibleChildrenLength = 0;
49+ for(var i=0; i<children.length; i++) {
50+ if (children[i] != repeater) {
51+ var child = children[i]
52+ /* currentLensId for home is empty */
53+ if (child.lensId == currentLensId || currentLensId == "") {
54+ /* make sure this isn't the first icon, and if so activate the last one */
55+ if (visibleChildrenLength == 0) {
56+ var childLast = children[numberOfChildren]
57+ dash.activateLens(childLast.lensId)
58+ return
59+ } else {
60+ if (i == 1) {
61+ dash.activateHome();
62+ return
63+ }
64+ var childPrevious = children[i-1]
65+ dash.activateLens(childPrevious.lensId)
66+ return
67+ }
68+ }
69+ visibleChildrenLength++
70+ }
71+ }
72+ }
73+
74 /* Need to manually include the Home lens */
75 LensButton {
76 id: homeLens
77@@ -115,6 +174,8 @@
78
79 model: visibleLenses
80 delegate: LensButton {
81+ property string lensId: item.id
82+
83 Accessible.name: u2d.tr(item.name)
84
85 /* Heuristic: if iconHint does not contain a '/' then it is an icon name */
86
87=== modified file 'places/dash.qml'
88--- places/dash.qml 2011-11-18 11:33:28 +0000
89+++ places/dash.qml 2011-11-23 13:00:17 +0000
90@@ -145,6 +145,19 @@
91
92 property variant lenses: Lenses {}
93
94+ Keys.onPressed: {
95+ if ((event.key == Qt.Key_Backtab && event.modifiers & Qt.ControlModifier) ||
96+ (event.key == Qt.Key_PageDown && event.modifiers & Qt.ControlModifier)) {
97+ lensBar.activatePrevious(dashView.activeLens)
98+ event.accepted = true;
99+ }
100+ if ((event.key == Qt.Key_Tab && event.modifiers & Qt.ControlModifier) ||
101+ (event.key == Qt.Key_PageUp && event.modifiers & Qt.ControlModifier)) {
102+ lensBar.activateNext(dashView.activeLens)
103+ event.accepted = true;
104+ }
105+ }
106+
107 Item {
108 id: background
109

Subscribers

People subscribed via source and target branches