improve dnd behavior
This commit is contained in:
parent
105e6c173f
commit
7a8e3fe492
1 changed files with 15 additions and 0 deletions
|
|
@ -94,6 +94,7 @@ impl DockList {
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
// dbg!(&dock_objects);
|
// dbg!(&dock_objects);
|
||||||
|
|
||||||
let model = self.model();
|
let model = self.model();
|
||||||
model.splice(model.n_items(), 0, &dock_objects);
|
model.splice(model.n_items(), 0, &dock_objects);
|
||||||
return;
|
return;
|
||||||
|
|
@ -480,6 +481,20 @@ impl DockList {
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// TODO investigate why drop does not finish when dropping on some surfaces
|
||||||
|
// for now this is a fix that will cancel the drop after 100 ms and not completing.
|
||||||
|
drag_source.connect_drag_begin(|_self, drag| {
|
||||||
|
drag.connect_drop_performed(|_self| {
|
||||||
|
glib::timeout_add_local_once(
|
||||||
|
std::time::Duration::from_millis(100),
|
||||||
|
glib::clone!(@weak _self => move || {
|
||||||
|
_self.drop_done(false);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
imp.drag_source
|
imp.drag_source
|
||||||
.set(drag_source)
|
.set(drag_source)
|
||||||
.expect("Could not set saved drag source");
|
.expect("Could not set saved drag source");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue