mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-10 03:10:41 +00:00
Dialog gives focus to its content first
This commit is contained in:
parent
97d97afa8d
commit
5407c53545
@ -209,12 +209,14 @@ impl View for Dialog {
|
|||||||
|
|
||||||
fn take_focus(&mut self) -> bool {
|
fn take_focus(&mut self) -> bool {
|
||||||
// TODO: add a direction to the focus. Meanwhile, takes button first.
|
// TODO: add a direction to the focus. Meanwhile, takes button first.
|
||||||
if !self.buttons.is_empty() {
|
if self.content.take_focus() {
|
||||||
|
self.focus = Focus::Content;
|
||||||
|
true
|
||||||
|
} else if !self.buttons.is_empty() {
|
||||||
self.focus = Focus::Button(0);
|
self.focus = Focus::Button(0);
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
self.focus = Focus::Content;
|
false
|
||||||
self.content.take_focus()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user