Separate out get_status_line code
This commit is contained in:
parent
5d5a3e4a21
commit
6fe3f27c85
@ -379,6 +379,15 @@ impl Calculator {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_status_line(&self) -> String {
|
||||
format!(
|
||||
"[{}] [{}] [{}]",
|
||||
self.get_display_mode(),
|
||||
self.get_angle_mode(),
|
||||
if self.get_save_on_close() { "W" } else { "w" }
|
||||
)
|
||||
}
|
||||
|
||||
pub fn get_state(&self) -> &CalculatorState {
|
||||
&self.state
|
||||
}
|
||||
|
11
src/main.rs
11
src/main.rs
@ -194,16 +194,7 @@ impl App {
|
||||
Span::styled("q", Style::default().add_modifier(Modifier::BOLD)),
|
||||
Span::raw(" to exit, "),
|
||||
Span::styled("h", Style::default().add_modifier(Modifier::BOLD)),
|
||||
Span::raw(format!(
|
||||
" for help - [{}] [{}] [{}]",
|
||||
self.calculator.get_display_mode(),
|
||||
self.calculator.get_angle_mode(),
|
||||
if self.calculator.get_save_on_close() {
|
||||
"W"
|
||||
} else {
|
||||
"w"
|
||||
}
|
||||
)),
|
||||
Span::raw(format!(" for help - {}", self.calculator.get_status_line(),)),
|
||||
]
|
||||
}
|
||||
(None, _) => vec![
|
||||
|
Loading…
Reference in New Issue
Block a user