diff --git a/data/gtk/image_view.ui b/data/gtk/image_view.ui
index 5b55581..397ed73 100644
--- a/data/gtk/image_view.ui
+++ b/data/gtk/image_view.ui
@@ -17,12 +17,15 @@
diff --git a/data/gtk/window.ui b/data/gtk/window.ui
index 52db0f3..2ceed00 100644
--- a/data/gtk/window.ui
+++ b/data/gtk/window.ui
@@ -30,13 +30,6 @@
Primary Menu
-
-
- view-fullscreen-symbolic
- win.toggle-fullscreen
- Toggle Fullscreen
-
-
diff --git a/src/widgets/image_view.rs b/src/widgets/image_view.rs
index ec13b5f..d7fbfb3 100644
--- a/src/widgets/image_view.rs
+++ b/src/widgets/image_view.rs
@@ -349,6 +349,15 @@ impl LpImageView {
}
}
+ #[template_callback]
+ fn get_fullscreen_icon(&self, fullscreened: bool) -> &'static str {
+ if fullscreened {
+ "view-restore-symbolic"
+ } else {
+ "view-fullscreen-symbolic"
+ }
+ }
+
pub fn set_wallpaper(&self) -> anyhow::Result<()> {
let wallpaper = self.uri().context("No URI for current file")?;
let ctx = glib::MainContext::default();
diff --git a/src/window.rs b/src/window.rs
index 827f89e..663ff79 100644
--- a/src/window.rs
+++ b/src/window.rs
@@ -62,8 +62,6 @@ mod imp {
#[template_child]
pub menu_button: TemplateChild,
#[template_child]
- pub fullscreen_button: TemplateChild,
- #[template_child]
pub toast_overlay: TemplateChild,
#[template_child]
pub stack: TemplateChild,
@@ -219,20 +217,9 @@ impl LpWindow {
if fullscreen {
imp.flap.set_fold_policy(adw::FlapFoldPolicy::Always);
imp.headerbar.add_css_class("osd");
- imp.menu_button.unparent();
- imp.fullscreen_button.unparent();
- imp.headerbar.pack_end(&*imp.fullscreen_button);
- imp.headerbar.pack_end(&*imp.menu_button);
- imp.fullscreen_button.set_icon_name("view-restore-symbolic");
} else {
imp.flap.set_fold_policy(adw::FlapFoldPolicy::Never);
imp.headerbar.remove_css_class("osd");
- imp.menu_button.unparent();
- imp.fullscreen_button.unparent();
- imp.headerbar.pack_end(&*imp.menu_button);
- imp.headerbar.pack_end(&*imp.fullscreen_button);
- imp.fullscreen_button
- .set_icon_name("view-fullscreen-symbolic");
}
self.set_fullscreened(fullscreen);