refactor: use zoom_factor() method in footer
Simplifies the zoom text calculation and eliminates the 'method zoom_factor is never used' warning.
This commit is contained in:
parent
4593986fc6
commit
c132265d31
1 changed files with 7 additions and 2 deletions
|
|
@ -15,8 +15,13 @@ pub fn view(model: &AppModel) -> Element<'_, AppMessage> {
|
|||
// Zoom level display.
|
||||
let zoom_text = match model.view_mode {
|
||||
ViewMode::Fit => "Fit".to_string(),
|
||||
ViewMode::ActualSize => "100%".to_string(),
|
||||
ViewMode::Custom(z) => format!("{}%", (z * 100.0).round() as i32),
|
||||
_ => {
|
||||
if let Some(zoom) = model.zoom_factor() {
|
||||
format!("{}%", (zoom * 100.0).round() as i32)
|
||||
} else {
|
||||
"Fit".to_string()
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Document dimensions (if available).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue