mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
replace deprecated Picture::for_pixbuf method with Picture::for_paintable
This commit is contained in:
parent
6ca1b3ce9a
commit
c5ca74702a
3 changed files with 13 additions and 8 deletions
|
|
@ -1,4 +1,8 @@
|
|||
use gtk::{gdk_pixbuf::Pixbuf, prelude::WidgetExt, ContentFit, Picture};
|
||||
use gtk::{
|
||||
gdk::Paintable,
|
||||
prelude::{IsA, WidgetExt},
|
||||
ContentFit, Picture,
|
||||
};
|
||||
|
||||
pub struct Image {
|
||||
gobject: Picture,
|
||||
|
|
@ -12,8 +16,8 @@ impl Image {
|
|||
|
||||
// Constructors
|
||||
|
||||
pub fn new_from_pixbuf(buffer: &Pixbuf) -> Self {
|
||||
let gobject = Picture::for_pixbuf(buffer);
|
||||
pub fn new_from_paintable(paintable: &impl IsA<Paintable>) -> Self {
|
||||
let gobject = Picture::for_paintable(paintable);
|
||||
|
||||
gobject.set_content_fit(Self::DEFAULT_CONTENT_FIT);
|
||||
gobject.set_margin_end(Self::DEFAULT_MARGIN);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue