Add alignment to header

This commit is contained in:
Austen Adler 2021-05-19 19:00:49 -04:00
parent a83e680521
commit f7cd14549e
2 changed files with 11 additions and 1 deletions

View File

@ -383,9 +383,10 @@ impl Calculator {
pub fn get_status_line(&self) -> String {
format!(
"[{}] [{}] [{}]",
"[{}] [{}] [{}] [{}]",
self.display_mode,
self.angle_mode,
self.calculator_alignment,
if self.save_on_close { "W" } else { "w" }
)
}

View File

@ -107,3 +107,12 @@ impl Default for CalculatorAlignment {
CalculatorAlignment::Left
}
}
impl fmt::Display for CalculatorAlignment {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
CalculatorAlignment::Left => write!(f, "L"),
CalculatorAlignment::Right => write!(f, "R"),
}
}
}