Remove obsolete copy_pixbuf() function
This is now in gdk_pixbuf library anyway.
This commit is contained in:
parent
7904c00aa8
commit
ef2eb24328
@ -3,29 +3,12 @@
|
|||||||
|
|
||||||
use errors::*;
|
use errors::*;
|
||||||
use gdk_pixbuf;
|
use gdk_pixbuf;
|
||||||
use gdk_pixbuf_sys;
|
|
||||||
use glib::translate::FromGlibPtrFull;
|
|
||||||
use glib::translate::ToGlibPtr;
|
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use gtk;
|
use gtk;
|
||||||
use std::path::*;
|
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.
|
/// Get a pixbuf by name from the given theme with the requested size.
|
||||||
/// Note that the size is not enforced, but rather a hint.
|
/// Note that the size is not enforced, but rather a hint.
|
||||||
pub fn pixbuf_new_from_theme(
|
pub fn pixbuf_new_from_theme(
|
||||||
|
@ -222,7 +222,7 @@ impl VolMeter {
|
|||||||
let i_width = pixbuf.get_width() as i64;
|
let i_width = pixbuf.get_width() as i64;
|
||||||
let i_height = pixbuf.get_height() 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 vm_width = i_width / 6;
|
||||||
let x = (self.x_offset_pct as f64 *
|
let x = (self.x_offset_pct as f64 *
|
||||||
|
Loading…
Reference in New Issue
Block a user