From 1f28cbdf1dbe26e4c7da27323a0202a3276cb3a7 Mon Sep 17 00:00:00 2001 From: Rubén Beltrán del Río Date: Thu, 26 Mar 2026 23:18:11 +0100 Subject: Move footer to its own component --- src/handlers/zoom.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/handlers') diff --git a/src/handlers/zoom.rs b/src/handlers/zoom.rs index 575f5f9..59a54a7 100644 --- a/src/handlers/zoom.rs +++ b/src/handlers/zoom.rs @@ -13,28 +13,30 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +use relm4::prelude::*; + use crate::AppModel; use crate::constants; +use crate::components::footer::FooterAction; /// Sets the zoom level and updates the rendered image. pub fn zoom(model: &mut AppModel, level: f64) { model.zoom = level; model.update_image(); + model.footer.emit(FooterAction::SetZoom(level)); } /// Decreases zoom by one step if above minimum. pub fn zoom_out(model: &mut AppModel) { let new_zoom = model.zoom - constants::ZOOM_STEP; if new_zoom >= constants::MIN_ZOOM { - model.zoom = new_zoom; - model.update_image(); + zoom(model, new_zoom); } } /// Increases zoom by one step if below maximum. pub fn zoom_in(model: &mut AppModel) { if model.zoom < constants::MAX_ZOOM { - model.zoom += constants::ZOOM_STEP; - model.update_image(); + zoom(model, model.zoom + constants::ZOOM_STEP); } } -- cgit