mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Fix linear layout focus switch
This commit is contained in:
parent
5059e21cb1
commit
d9e4512752
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user