hammond-gtk::utils: change the signature of get_pixbug_from_path and rename it

Requires a gtk::Image as argument now, it sets the pixbuf to the
img directly instead of returning it.
New name is set_image_from_path.

This is ground work so we can later keep the image reference, and
use it to set the image with a callback.
This commit is contained in:
Jordan Petridis
2018-03-28 21:47:10 +03:00
parent 89ee174ded
commit daa8f15ce9
4 changed files with 20 additions and 16 deletions
+2 -4
View File
@@ -10,7 +10,7 @@ use hammond_data::dbqueries;
use hammond_data::utils::replace_extra_spaces;
use app::Action;
use utils::get_pixbuf_from_path;
use utils::set_image_from_path;
use widgets::episode::episodes_listbox;
use std::sync::Arc;
@@ -113,9 +113,7 @@ impl ShowWidget {
/// Set the show cover.
fn set_cover(&self, pd: Arc<Podcast>) -> Result<(), Error> {
let image = get_pixbuf_from_path(&pd.into(), 128)?;
self.cover.set_from_pixbuf(&image);
Ok(())
set_image_from_path(&self.cover, &pd.into(), 128)
}
/// Set the descripton text.