mirror of
https://gitlab.freedesktop.org/pipewire/helvum
synced 2026-03-15 03:26:10 +08:00
port: add the dragged port as the drag icon
This makes it the port label follows your cursor around instead of the generic text document icon that doesn't make a lot of sense here.
This commit is contained in:
@@ -158,9 +158,11 @@ impl Port {
|
|||||||
Direction::Output => ForwardLink(id).to_value(),
|
Direction::Output => ForwardLink(id).to_value(),
|
||||||
}))
|
}))
|
||||||
.build();
|
.build();
|
||||||
drag_src.connect_drag_begin(move |_, _| {
|
drag_src.connect_drag_begin(clone!(@weak res as obj => move |source, _| {
|
||||||
trace!("Drag started from port {}", id);
|
trace!("Drag started from port {}", id);
|
||||||
});
|
let paintable = gtk::WidgetPaintable::new(Some(&obj));
|
||||||
|
source.set_icon(Some(&paintable), 0, 0);
|
||||||
|
}));
|
||||||
drag_src.connect_drag_cancel(move |_, _, _| {
|
drag_src.connect_drag_cancel(move |_, _, _| {
|
||||||
trace!("Drag from port {} was cancelled", id);
|
trace!("Drag from port {} was cancelled", id);
|
||||||
false
|
false
|
||||||
|
|||||||
Reference in New Issue
Block a user