Last fixes
All checks were successful
Cargo CI / Build and Test (pull_request) Successful in 1m42s
Cargo CI / Lint (pull_request) Successful in 1m14s

This commit is contained in:
Wojciech Kozlowski 2024-02-10 23:20:46 +01:00
parent 78fcbafc04
commit adbdcee58c

View File

@ -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
}
}