Fix linear layout focus switch

This commit is contained in:
Alexandre Bury 2016-07-13 22:16:55 -07:00
parent 5059e21cb1
commit d9e4512752

View File

@ -117,7 +117,8 @@ impl LinearLayout {
.map(Child::as_mut)
.position(View::take_focus) {
self.focus = i;
// We're looking at the list in reverse
self.focus -= i+1;
EventResult::Consumed(None)
} else {
EventResult::Ignored
@ -130,7 +131,8 @@ impl LinearLayout {
.rev()
.map(Child::as_mut)
.position(View::take_focus) {
self.focus = i;
// Our slice doesn't start at 0
self.focus += i + 1;
EventResult::Consumed(None)
} else {
EventResult::Ignored