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)
|
.map(Child::as_mut)
|
||||||
.position(View::take_focus) {
|
.position(View::take_focus) {
|
||||||
|
|
||||||
self.focus = i;
|
// We're looking at the list in reverse
|
||||||
|
self.focus -= i+1;
|
||||||
EventResult::Consumed(None)
|
EventResult::Consumed(None)
|
||||||
} else {
|
} else {
|
||||||
EventResult::Ignored
|
EventResult::Ignored
|
||||||
@ -130,7 +131,8 @@ impl LinearLayout {
|
|||||||
.rev()
|
.rev()
|
||||||
.map(Child::as_mut)
|
.map(Child::as_mut)
|
||||||
.position(View::take_focus) {
|
.position(View::take_focus) {
|
||||||
self.focus = i;
|
// Our slice doesn't start at 0
|
||||||
|
self.focus += i + 1;
|
||||||
EventResult::Consumed(None)
|
EventResult::Consumed(None)
|
||||||
} else {
|
} else {
|
||||||
EventResult::Ignored
|
EventResult::Ignored
|
||||||
|
Loading…
Reference in New Issue
Block a user