From 0a94484bab2c5aa653fb255c4d73048d97e1836d Mon Sep 17 00:00:00 2001 From: Sophie Herold Date: Thu, 27 Apr 2023 20:48:59 +0200 Subject: [PATCH] window: Leave fullscreen when status page is shown We don't allow to fullscreen without image. So if last image is deleted, let's leave fullscreen since there are no controls to leave it. Closes #150 Part-of: --- src/window.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/window.rs b/src/window.rs index 7371f4a..76d5943 100644 --- a/src/window.rs +++ b/src/window.rs @@ -241,7 +241,7 @@ mod imp { // and keeps the others usable gtk::WindowGroup::new().add_window(&*obj); - obj.images_available(); + obj.on_images_available(); let current_image_signals = self.image_view.current_image_signals(); // clone! is a macro from glib-rs that allows @@ -295,7 +295,7 @@ mod imp { self.image_view.connect_notify_local( Some("current-page"), glib::clone!(@weak obj => move |_, _| { - obj.images_available(); + obj.on_images_available(); }), ); @@ -606,7 +606,7 @@ impl LpWindow { } /// Handles change in availability of images - fn images_available(&self) { + fn on_images_available(&self) { let imp = self.imp(); let shows_image = imp.image_view.current_page().is_some(); @@ -619,9 +619,10 @@ impl LpWindow { imp.image_view.grab_focus(); self.queue_hide_controls(); } else { - imp.properties_button.set_active(false); imp.stack.set_visible_child(&*imp.status_page); imp.status_page.grab_focus(); + // Leave fullscreen since status page has no controls to leave it + self.set_fullscreened(false); } }