replace deprecated Picture::for_pixbuf method with Picture::for_paintable

This commit is contained in:
yggverse 2024-11-22 14:45:39 +02:00
parent 6ca1b3ce9a
commit c5ca74702a
3 changed files with 13 additions and 8 deletions

View file

@ -8,9 +8,9 @@ use text::Text;
use crate::app::browser::window::{tab::item::Action as TabAction, Action as WindowAction};
use gtk::{
gdk_pixbuf::Pixbuf,
gdk::Paintable,
glib::Uri,
prelude::{BoxExt, WidgetExt},
prelude::{BoxExt, IsA, WidgetExt},
Box, Orientation,
};
use std::{rc::Rc, time::Duration};
@ -38,9 +38,9 @@ impl Content {
/// Set new `content::Image` component for `Self`
///
/// * action removes previous children component from `Self`
pub fn to_image(&self, buffer: &Pixbuf) -> Image {
pub fn to_image(&self, paintable: &impl IsA<Paintable>) -> Image {
self.clean();
let image = Image::new_from_pixbuf(buffer);
let image = Image::new_from_paintable(paintable);
self.gobject.append(image.gobject());
image
}