diff --git a/TODO.md b/TODO.md index 0316ac8..1ed5678 100644 --- a/TODO.md +++ b/TODO.md @@ -1,14 +1,9 @@ ## TODOs: -**General:** - -- [ ] Write docs - ## Planned Features ## Priorities: -- [ ] Discuss and decide when to schedule the download cleaner. [#3](https://gitlab.gnome.org/alatiera/Hammond/issues/3) - [ ] Unplayed Only and Downloaded only view. - [ ] Auto-updater - [ ] OPML import/export // Probably need to create a crate. diff --git a/hammond-gtk/src/content.rs b/hammond-gtk/src/content.rs index 2a8659a..f707b76 100644 --- a/hammond-gtk/src/content.rs +++ b/hammond-gtk/src/content.rs @@ -11,12 +11,20 @@ use views::empty::EmptyView; #[derive(Debug)] pub struct Content { pub stack: gtk::Stack, - pub state: ContentState, widget: PodcastWidget, - pub podcasts: PopulatedView, + podcasts: PopulatedView, empty: EmptyView, } +// #[derive(Debug)] +// pub struct Content { +// pub stack: gtk::Stack, +// pub state: ContentState, +// widget: PodcastWidget, +// pub podcasts: PopulatedView, +// empty: EmptyView, +// } + #[derive(Debug)] #[allow(dead_code)] // TODO: find a way to wrap gtk::Stack into a State machine. @@ -32,12 +40,9 @@ impl Content { let widget = PodcastWidget::new(); let pop = PopulatedView::new(); let empty = EmptyView::new(); - // TODO: Avoid cloning - let state = ContentState::Populated(pop.clone()); let content = Content { stack, - state, widget, empty, podcasts: pop, @@ -55,12 +60,14 @@ impl Content { self.stack.add_named(&self.podcasts.container, "podcasts"); self.stack.add_named(&self.empty.container, "empty"); - // FIXME: needs actuall logic self.stack.set_visible_child_name("podcasts") } fn init(&self) { self.setup_stack(); self.podcasts.init(&self.stack); + if self.podcasts.flowbox.get_children().is_empty() { + self.stack.set_visible_child_name("empty"); + } } } diff --git a/hammond-gtk/src/views/podcasts.rs b/hammond-gtk/src/views/podcasts.rs index 16168d1..8a2e4e4 100644 --- a/hammond-gtk/src/views/podcasts.rs +++ b/hammond-gtk/src/views/podcasts.rs @@ -12,7 +12,7 @@ use utils::get_pixbuf_from_path; #[derive(Debug, Clone)] pub struct PopulatedView { pub container: gtk::Box, - flowbox: gtk::FlowBox, + pub flowbox: gtk::FlowBox, viewport: gtk::Viewport, }