diff --git a/src/app/browser/window/tab/item/page/content.rs b/src/app/browser/window/tab/item/page/content.rs index 327a4d1f..901d68e0 100644 --- a/src/app/browser/window/tab/item/page/content.rs +++ b/src/app/browser/window/tab/item/page/content.rs @@ -7,6 +7,7 @@ use status::Status; use text::Text; use gtk::{ + gdk_pixbuf::Pixbuf, gio::SimpleAction, glib::{GString, Uri}, prelude::{BoxExt, WidgetExt}, @@ -34,10 +35,10 @@ impl Content { } // Actions - pub fn set_image(&self) { + pub fn set_image(&self, buffer: &Pixbuf) { self.clean(); - let image = Image::new(); + let image = Image::new_from_pixbuf(buffer); self.gobject.append(image.gobject()); } diff --git a/src/app/browser/window/tab/item/page/content/image.rs b/src/app/browser/window/tab/item/page/content/image.rs index 824c86e4..4fd36541 100644 --- a/src/app/browser/window/tab/item/page/content/image.rs +++ b/src/app/browser/window/tab/item/page/content/image.rs @@ -1,4 +1,4 @@ -use gtk::Picture; +use gtk::{gdk_pixbuf::Pixbuf, Picture}; pub struct Image { gobject: Picture, @@ -6,9 +6,9 @@ pub struct Image { impl Image { // Construct - pub fn new() -> Self { + pub fn new_from_pixbuf(buffer: &Pixbuf) -> Self { Self { - gobject: Picture::new(), + gobject: Picture::for_pixbuf(buffer), } }