diff --git a/data/gtk/image_view.ui b/data/gtk/image_view.ui
index 88af8a38f36d11f00ec08b1e64010e0e511d0237..397ed73fd75e5fd633e14bb40fb8ecfe3ab1b6c7 100644
--- a/data/gtk/image_view.ui
+++ b/data/gtk/image_view.ui
@@ -16,34 +16,55 @@
-
-
-
- True
- end
- center
- 18
- 18
- go-next-symbolic
- iv.next
- Next Image
-
+ 18
+ 18
+ 12
+
+
+ start
+ go-previous-symbolic
+ iv.previous
+ Previous Image
+
+
+
+
+
+ go-next-symbolic
+ iv.next
+ Next Image
+
+
+
+
+
+ True
+ end
+
+
+
+ LpImageView
+
+
+
+ win.toggle-fullscreen
+ Toggle Fullscreen
+
+
+
diff --git a/data/gtk/window.ui b/data/gtk/window.ui
index bf803d3f7ad80499f634fd75c7507714bf12b4f7..2ceed00c863b32b388b8fc050a48fb59f4097ea2 100644
--- a/data/gtk/window.ui
+++ b/data/gtk/window.ui
@@ -16,6 +16,13 @@
diff --git a/src/widgets/image_view.rs b/src/widgets/image_view.rs
index ec13b5f2818336bcc753d349046dd39c478675f3..d7fbfb3b16efe13da39200ed9f0d792386df3251 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 95a6a28c76dcf39aad5b085e702fe7876911ed15..663ff79b0a27d2804cf1a269232f7377dfcb18ed 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);
@@ -312,6 +299,11 @@ impl LpWindow {
if let Err(e) = imp.image_view.copy() {
log::error!("Failed to copy to clipboard: {}", e);
+ } else {
+ self.show_toast(
+ &"Image copied to clipboard".to_string(),
+ adw::ToastPriority::High,
+ );
}
}