Nux

Merge lp:~azzar1/nux/hgrid-kn-update into lp:nux/2.0

Proposed by Andrea Azzarone
Status: Merged
Approved by: Andrea Azzarone
Approved revision: 572
Merged at revision: 573
Proposed branch: lp:~azzar1/nux/hgrid-kn-update
Merge into: lp:nux/2.0
Diff against target: 53 lines (+14/-3)
2 files modified
Nux/GridHLayout.cpp (+11/-0)
tests/xtest-hgrid-key-navigation.cpp (+3/-3)
To merge this branch: bzr merge lp:~azzar1/nux/hgrid-kn-update
Reviewer Review Type Date Requested Status
Jason Smith (community) Approve
Review via email: mp+92741@code.launchpad.net

Description of the change

Update the hgrid keyboard navigation.

To post a comment you must log in.
Revision history for this message
Jason Smith (jassmith) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Nux/GridHLayout.cpp'
2--- Nux/GridHLayout.cpp 2012-01-20 22:15:09 +0000
3+++ Nux/GridHLayout.cpp 2012-02-13 11:26:18 +0000
4@@ -615,12 +615,23 @@
5 return NULL;
6 }
7
8+ if ((direction == KEY_NAV_LEFT) && position % nun_column == 0)
9+ {
10+ return NULL;
11+ }
12+
13 if ((direction == KEY_NAV_RIGHT) && (it_next == _layout_element_list.end()))
14 {
15 // last item
16 return NULL;
17 }
18
19+ if ((direction == KEY_NAV_RIGHT) && position % nun_column == nun_column - 1)
20+ {
21+ // last item
22+ return NULL;
23+ }
24+
25 if ((direction == KEY_NAV_UP) && ((position / nun_column) == 0))
26 {
27 // top edge
28
29=== modified file 'tests/xtest-hgrid-key-navigation.cpp'
30--- tests/xtest-hgrid-key-navigation.cpp 2012-01-27 22:37:13 +0000
31+++ tests/xtest-hgrid-key-navigation.cpp 2012-02-13 11:26:18 +0000
32@@ -119,7 +119,7 @@
33
34
35 // Rigth key
36- for (int i=0; i<10; ++i)
37+ for (int i=0; i<3; ++i)
38 {
39 test.SendFakeKeyEvent(XK_Right, 0);
40 nux::SleepForMilliseconds(500);
41@@ -130,10 +130,10 @@
42 // Another right key, should do nothing
43 test.SendFakeKeyEvent(XK_Right, 0);
44 nux::SleepForMilliseconds(500);
45- test.TestReportMsg(key_navigation_test->tiles_[10]->has_focus_, "Right key, last element");
46+ test.TestReportMsg(key_navigation_test->tiles_[3]->has_focus_, "Right key, last element");
47
48 // Left key
49- for (int i=10; i>0; --i)
50+ for (int i=3; i>0; --i)
51 {
52 test.SendFakeKeyEvent(XK_Left, 0);
53 nux::SleepForMilliseconds(500);

Subscribers

People subscribed via source and target branches

to all changes: