Remove obsolete copy_pixbuf() function

This is now in gdk_pixbuf library anyway.
This commit is contained in:
Julian Ospald 2017-07-22 17:11:55 +02:00
parent 7904c00aa8
commit ef2eb24328
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
2 changed files with 1 additions and 18 deletions

View File

@ -3,29 +3,12 @@
use errors::*;
use gdk_pixbuf;
use gdk_pixbuf_sys;
use glib::translate::FromGlibPtrFull;
use glib::translate::ToGlibPtr;
use gtk::prelude::*;
use gtk;
use std::path::*;
/// Copy a `Pixbuf` explicitly, since they don't implement the `Copy` trait.
/// Currently does not call `gdk_pixbuf_copy_options()`.
pub fn copy_pixbuf(pixbuf: &gdk_pixbuf::Pixbuf) -> gdk_pixbuf::Pixbuf {
let new_pixbuf = unsafe {
let gdk_pixbuf = pixbuf.to_glib_none().0;
let copy = gdk_pixbuf_sys::gdk_pixbuf_copy(gdk_pixbuf);
FromGlibPtrFull::from_glib_full(copy)
};
return new_pixbuf;
}
/// Get a pixbuf by name from the given theme with the requested size.
/// Note that the size is not enforced, but rather a hint.
pub fn pixbuf_new_from_theme(

View File

@ -222,7 +222,7 @@ impl VolMeter {
let i_width = pixbuf.get_width() as i64;
let i_height = pixbuf.get_height() as i64;
let new_pixbuf = copy_pixbuf(pixbuf);
let new_pixbuf = pixbuf.copy();
let vm_width = i_width / 6;
let x = (self.x_offset_pct as f64 *