Update gtk-rs

This brings us a neat new function, `imp()`,
that lets us drop `from_instance()` everywhere.
This commit is contained in:
Christopher Davis 2021-12-29 14:02:48 -08:00
parent 400672b6b6
commit 56a47fb447
4 changed files with 48 additions and 48 deletions

View file

@ -173,13 +173,13 @@ glib::wrapper! {
impl LpImage {
pub fn file(&self) -> Option<gio::File> {
let imp = imp::LpImage::from_instance(self);
let imp = self.imp();
imp.file.borrow().clone()
}
pub fn set_file(&self, file: &gio::File) {
let imp = imp::LpImage::from_instance(self);
let imp = self.imp();
match gdk::Texture::from_file(file) {
Ok(texture) => {
@ -197,12 +197,12 @@ impl LpImage {
}
pub fn image_width(&self) -> i32 {
let imp = imp::LpImage::from_instance(&self);
let imp = self.imp();
imp.image_width.get()
}
pub fn image_height(&self) -> i32 {
let imp = imp::LpImage::from_instance(&self);
let imp = self.imp();
imp.image_height.get()
}
}