diff --git a/src/calc.rs b/src/calc.rs index 5e8688b..2bdbb47 100644 --- a/src/calc.rs +++ b/src/calc.rs @@ -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 } diff --git a/src/main.rs b/src/main.rs index dc92d59..6e44c26 100644 --- a/src/main.rs +++ b/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![