mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +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 {
|
||||
// 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);
|
||||
true
|
||||
} else {
|
||||
self.focus = Focus::Content;
|
||||
self.content.take_focus()
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user