Update dependencies

This commit is contained in:
Tom A. Wagner
2023-08-17 20:14:23 +02:00
parent 7145c83ae1
commit bf5c7e4636
7 changed files with 264 additions and 329 deletions

View File

@@ -357,7 +357,7 @@ mod imp {
drop.read_value_async(
Port::static_type(),
glib::PRIORITY_DEFAULT,
glib::Priority::DEFAULT,
Option::<&gio::Cancellable>::None,
clone!(@weak self as imp => move|value| {
let Ok(value) = value else {
@@ -407,9 +407,9 @@ mod imp {
.unwrap();
widget.set_zoom_factor(widget.zoom_factor() + (0.1 * -delta_y), None);
gtk::Inhibit(true)
glib::Propagation::Stop
} else {
gtk::Inhibit(false)
glib::Propagation::Proceed
}
});
self.obj().add_controller(scroll_controller);
@@ -576,6 +576,7 @@ mod imp {
let (output_anchor, input_anchor) = match port.direction() {
Direction::Output => (&port_anchor, &other_anchor),
Direction::Input => (&other_anchor, &port_anchor),
_ => unreachable!(),
};
self.draw_link(link_cr, output_anchor, input_anchor, false);

View File

@@ -82,24 +82,13 @@ mod imp {
}
}
#[glib::derived_properties]
impl ObjectImpl for Node {
fn constructed(&self) {
self.parent_constructed();
self.grid.set_parent(&*self.obj());
}
fn properties() -> &'static [glib::ParamSpec] {
Self::derived_properties()
}
fn property(&self, id: usize, pspec: &glib::ParamSpec) -> glib::Value {
Self::derived_property(self, id, pspec)
}
fn set_property(&self, id: usize, value: &glib::Value, pspec: &glib::ParamSpec) {
Self::derived_set_property(self, id, value, pspec)
}
fn dispose(&self) {
self.grid.unparent();
}
@@ -133,6 +122,7 @@ impl Node {
imp.grid.attach(&port, 1, imp.num_ports_out.get() + 1, 1, 1);
imp.num_ports_out.set(imp.num_ports_out.get() + 1);
}
_ => unreachable!(),
}
imp.ports.borrow_mut().insert(port);
@@ -144,6 +134,7 @@ impl Node {
match port.direction() {
Direction::Input => imp.num_ports_in.set(imp.num_ports_in.get() - 1),
Direction::Output => imp.num_ports_in.set(imp.num_ports_out.get() - 1),
_ => unreachable!(),
}
port.unparent();

View File

@@ -63,6 +63,7 @@ mod imp {
}
}
#[glib::derived_properties]
impl ObjectImpl for Port {
fn constructed(&self) {
self.parent_constructed();
@@ -80,18 +81,6 @@ mod imp {
self.label.unparent()
}
fn properties() -> &'static [glib::ParamSpec] {
Self::derived_properties()
}
fn property(&self, id: usize, pspec: &glib::ParamSpec) -> glib::Value {
Self::derived_property(self, id, pspec)
}
fn set_property(&self, id: usize, value: &glib::Value, pspec: &glib::ParamSpec) {
Self::derived_set_property(self, id, value, pspec)
}
fn signals() -> &'static [Signal] {
static SIGNALS: Lazy<Vec<Signal>> = Lazy::new(|| {
vec![Signal::builder("port-toggled")
@@ -182,6 +171,7 @@ mod imp {
let (output_port, input_port) = match port.direction() {
Direction::Output => (&port, &other_port),
Direction::Input => (&other_port, &port),
_ => unreachable!(),
};
port.emit_by_name::<()>(
@@ -229,8 +219,9 @@ impl Port {
res
}
pub fn direction(&self) -> &Direction {
self.imp()
pub fn direction(&self) -> Direction {
*self
.imp()
.direction
.get()
.expect("Port direction is not set")
@@ -247,6 +238,7 @@ impl Port {
match self.direction() {
Direction::Output => self.width() as f32 + padding_right + border_right,
Direction::Input => 0.0 - padding_left - border_left,
_ => unreachable!(),
},
self.height() as f32 / 2.0,
)