diff --git a/data/resources/icons/scalable/actions/image-round-symbolic.svg b/data/resources/icons/scalable/actions/image-round-symbolic.svg
new file mode 100644
index 0000000..0f687ca
--- /dev/null
+++ b/data/resources/icons/scalable/actions/image-round-symbolic.svg
@@ -0,0 +1,2 @@
+
+
diff --git a/data/resources/style.css b/data/resources/style.css
index 617a069..d4bc7dc 100644
--- a/data/resources/style.css
+++ b/data/resources/style.css
@@ -39,10 +39,18 @@ outline {
}
/* Drag overlay */
-.lp-dragging-area-highlight {
- border-radius: 8px;
- background-color: color-mix(in srgb, var(--accent-bg-color) 35%, transparent);
- margin: 24px;
+lpdragoverlay .overlay-status {
+ color: var(--accent-color);
+ background-color: color-mix(in srgb, var(--accent-bg-color) 8%, transparent);
+ /* Same color for border as for icon and label */
+ /* Probably due to a GTK bug, this currently does not give the exact same color */
+ border: 2px dashed color-mix(in srgb, currentColor var(--dim-opacity), transparent);
+ border-radius: 2px;
+ margin: 12px;
+}
+
+lpdragoverlay .overlay-status label {
+ opacity: var(--dim-opacity);
}
lpprintpreview {
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 72fffc5..7c0098d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -20,6 +20,7 @@ src/util.rs
src/util/gettext.rs
src/widgets.rs
src/widgets/drag_overlay.rs
+src/widgets/drag_overlay.ui
src/widgets/error_details.rs
src/widgets/error_details.ui
src/widgets/image.rs
diff --git a/src/util.rs b/src/util.rs
index 99c513f..1155c57 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -1,5 +1,5 @@
// Copyright (c) 2021-2023 Christopher Davis
-// Copyright (c) 2022-2023 Sophie Herold
+// Copyright (c) 2022-2024 Sophie Herold
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
diff --git a/src/widgets/drag_overlay.rs b/src/widgets/drag_overlay.rs
index c476c6d..8e7b1d4 100644
--- a/src/widgets/drag_overlay.rs
+++ b/src/widgets/drag_overlay.rs
@@ -20,29 +20,31 @@
//!
//! This implementation is inspired by [Amberol](https://gitlab.gnome.org/World/amberol)
+use std::cell::OnceCell;
+use std::marker::PhantomData;
+
use adw::prelude::*;
+use adw::subclass::prelude::*;
+use glib::Properties;
+use gtk::CompositeTemplate;
use crate::deps::*;
mod imp {
- use std::cell::OnceCell;
-
- use adw::subclass::prelude::*;
- use glib::{ParamSpec, Properties, Value};
use super::*;
- #[derive(Debug, Default, Properties)]
+ #[derive(Debug, Default, CompositeTemplate, Properties)]
#[properties(wrapper_type = super::LpDragOverlay)]
+ #[template(file = "drag_overlay.ui")]
pub struct LpDragOverlay {
- /// Usual content
- #[property(set = Self::set_child)]
- pub child: Option,
/// Widget overplayed when dragging over child
- #[property(set = Self::set_overlayed)]
- pub overlayed: Option,
- pub overlay: gtk::Overlay,
- pub revealer: gtk::Revealer,
+ #[property(set = Self::set_content)]
+ pub content: PhantomData