Last fixes
This commit is contained in:
parent
78fcbafc04
commit
adbdcee58c
@ -354,17 +354,18 @@ struct Minibuffer<'a> {
|
||||
|
||||
impl Minibuffer<'_> {
|
||||
fn paragraphs(state: &AppPublicState) -> Self {
|
||||
match state {
|
||||
let columns = 3;
|
||||
let mb = match state {
|
||||
AppState::Browse(_) => Minibuffer {
|
||||
paragraphs: vec![
|
||||
Paragraph::new("m: show info overlay"),
|
||||
Paragraph::new("g: show reload menu"),
|
||||
],
|
||||
columns: 3,
|
||||
columns,
|
||||
},
|
||||
AppState::Info(_) => Minibuffer {
|
||||
paragraphs: vec![Paragraph::new("m: hide info overlay")],
|
||||
columns: 3,
|
||||
columns,
|
||||
},
|
||||
AppState::Reload(_) => Minibuffer {
|
||||
paragraphs: vec![
|
||||
@ -372,17 +373,23 @@ impl Minibuffer<'_> {
|
||||
Paragraph::new("d: reload database"),
|
||||
Paragraph::new("l: reload library"),
|
||||
],
|
||||
columns: 3,
|
||||
columns,
|
||||
},
|
||||
AppState::Error(_) => Minibuffer {
|
||||
paragraphs: vec![Paragraph::new("Press any key to dismiss the error message...")],
|
||||
paragraphs: vec![Paragraph::new(
|
||||
"Press any key to dismiss the error message...",
|
||||
)],
|
||||
columns: 1,
|
||||
},
|
||||
AppState::Critical(_) => Minibuffer {
|
||||
paragraphs: vec![Paragraph::new("Press ctrl+c to terminate the program...")],
|
||||
columns: 1,
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
// Callers will assume this.
|
||||
assert!(mb.columns >= mb.paragraphs.len() as u16);
|
||||
mb
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user