Temporary removed unused Content.fields.

This commit is contained in:
Jordan Petridis 2017-12-01 07:30:28 +02:00
parent 0359e9dd35
commit 8d63db047a
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6

View File

@ -11,9 +11,9 @@ use views::empty::EmptyView;
#[derive(Debug)] #[derive(Debug)]
pub struct Content { pub struct Content {
pub stack: gtk::Stack, pub stack: gtk::Stack,
widget: PodcastWidget, // widget: PodcastWidget,
podcasts: PopulatedView, // podcasts: PopulatedView,
empty: EmptyView, // empty: EmptyView,
} }
// #[derive(Debug)] // #[derive(Debug)]
@ -37,33 +37,30 @@ pub enum ContentState {
impl Content { impl Content {
pub fn new() -> Content { pub fn new() -> Content {
let stack = gtk::Stack::new(); let stack = gtk::Stack::new();
let widget = PodcastWidget::new();
let pop = PopulatedView::new();
let empty = EmptyView::new();
let content = Content { let content = Content {
stack, stack,
widget, // widget,
empty, // empty,
podcasts: pop, // podcasts: pop,
}; };
content.init(); content.init();
content content
} }
fn setup_stack(&self) {
self.stack.add_named(&self.widget.container, "widget");
self.stack.add_named(&self.podcasts.container, "podcasts");
self.stack.add_named(&self.empty.container, "empty");
self.stack.set_visible_child_name("podcasts")
}
fn init(&self) { fn init(&self) {
self.setup_stack(); let widget = PodcastWidget::new();
self.podcasts.init(&self.stack); let podcasts = PopulatedView::new();
if self.podcasts.flowbox.get_children().is_empty() { let empty = EmptyView::new();
self.stack.add_named(&widget.container, "widget");
self.stack.add_named(&podcasts.container, "podcasts");
self.stack.add_named(&empty.container, "empty");
self.stack.set_visible_child_name("podcasts");
podcasts.init(&self.stack);
if podcasts.flowbox.get_children().is_empty() {
self.stack.set_visible_child_name("empty"); self.stack.set_visible_child_name("empty");
} }
} }