Constrain minimum zoom level

This commit is contained in:
pieterd 2025-12-23 13:41:44 +01:00 • committed by Sophie Herold
parent 6e2f38de56
commit f34f9dd988
3 changed files with 51 additions and 2 deletions

View file

@ -257,6 +257,18 @@ mod imp {
),
);
current_image_signals.connect_closure(
"notify::is-min-zoom",
false,
glib::closure_local!(
#[watch]
obj,
move |_: &LpImage, _: &glib::ParamSpec| {
obj.update_image_actions_status();
}
),
);
current_image_signals.connect_closure(
"notify::is-max-zoom",
false,
@ -759,7 +771,7 @@ impl LpImageWindow {
let can_zoom_out = self
.image_view()
.current_image()
.is_some_and(|image| !image.is_best_fit());
.is_some_and(|image| !image.is_best_fit() && !image.is_min_zoom());
let can_zoom_in = self
.image_view()
.current_image()