mirror of
https://gitlab.freedesktop.org/pipewire/helvum
synced 2026-03-16 03:56:12 +08:00
Delete items from graph when they are removed by the pipewire server.
This commit is contained in:
@@ -205,6 +205,14 @@ impl GraphView {
|
||||
private.nodes.borrow_mut().insert(id, node);
|
||||
}
|
||||
|
||||
pub fn remove_node(&self, id: u32) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let mut nodes = private.nodes.borrow_mut();
|
||||
if let Some(node) = nodes.remove(&id) {
|
||||
node.unparent();
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_port_to_node(&self, node_id: u32, port_id: u32, port: crate::view::port::Port) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
|
||||
@@ -229,6 +237,14 @@ impl GraphView {
|
||||
self.queue_draw();
|
||||
}
|
||||
|
||||
pub fn remove_link(&self, id: u32) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let mut links = private.links.borrow_mut();
|
||||
links.remove(&id);
|
||||
|
||||
self.queue_draw();
|
||||
}
|
||||
|
||||
pub fn set_dragged(&self, widget: Option<gtk::Widget>) {
|
||||
*imp::GraphView::from_instance(self).dragged.borrow_mut() = widget;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user