diff --git a/hammond-gtk/gtk/podcast_widget.ui b/hammond-gtk/gtk/podcast_widget.ui index fb206d1..e1d833a 100644 --- a/hammond-gtk/gtk/podcast_widget.ui +++ b/hammond-gtk/gtk/podcast_widget.ui @@ -95,6 +95,8 @@ True True True + center + center True @@ -119,6 +121,8 @@ Warn: This will delete downloaded content associated with this Podcast.True True Mark all episodes as Played. + center + center True diff --git a/hammond-gtk/src/headerbar.rs b/hammond-gtk/src/headerbar.rs index a71e821..f5472b0 100644 --- a/hammond-gtk/src/headerbar.rs +++ b/hammond-gtk/src/headerbar.rs @@ -1,8 +1,10 @@ use gtk; use gtk::prelude::*; -use index_feed; +use hammond_data::index_feed; use hammond_data::index_feed::Database; + +use podcasts_view::update_podcasts_view; use utils; // http://gtk-rs.org/tuto/closures @@ -53,7 +55,16 @@ pub fn get_headerbar(db: &Database, stack: >k::Stack) -> gtk::HeaderBar { // TODO: make it a back arrow button, that will hide when appropriate, // and add a StackSwitcher when more views are added. - home_button.connect_clicked(clone!(stack => move |_| stack.set_visible_child_name("pd_grid"))); + home_button.connect_clicked(clone!(db, stack => move |_| { + let vis = stack.get_visible_child_name().unwrap(); + if vis == "pd_grid" { + // More conviniet way to reload podcasts_flowbox while trying out stuff. + // Ideally, the functionality should be removed from final design. + update_podcasts_view(&db, &stack); + } else { + stack.set_visible_child_name("pd_grid"); + } + })); // FIXME: There appears to be a memmory leak here. refresh_button.connect_clicked(clone!(stack, db => move |_| { diff --git a/hammond-gtk/src/main.rs b/hammond-gtk/src/main.rs index 713df79..6525d6e 100644 --- a/hammond-gtk/src/main.rs +++ b/hammond-gtk/src/main.rs @@ -14,7 +14,6 @@ extern crate loggerv; extern crate open; use log::LogLevel; -use hammond_data::index_feed; use hammond_data::dbcheckup; use std::sync::{Arc, Mutex};