From b4b2f24c77e9fe772c42c4a2881161cb31ba0d34 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Fri, 1 Dec 2017 01:30:19 +0200 Subject: [PATCH] Use content struct instead of plain stack. --- hammond-gtk/resources/gtk/podcasts_view.ui | 2 +- hammond-gtk/src/content.rs | 3 +++ hammond-gtk/src/main.rs | 6 ++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hammond-gtk/resources/gtk/podcasts_view.ui b/hammond-gtk/resources/gtk/podcasts_view.ui index 4cdc447..5a3dff6 100644 --- a/hammond-gtk/resources/gtk/podcasts_view.ui +++ b/hammond-gtk/resources/gtk/podcasts_view.ui @@ -12,7 +12,7 @@ True in - + True False diff --git a/hammond-gtk/src/content.rs b/hammond-gtk/src/content.rs index 642078f..05eefb4 100644 --- a/hammond-gtk/src/content.rs +++ b/hammond-gtk/src/content.rs @@ -55,6 +55,9 @@ impl Content { self.stack.add_named(&self.widget.container, "pdw"); // Rename into "widget" self.stack.add_named(&self.podcasts.container, "fb_parent"); // Rename into "podcasts" self.stack.add_named(&self.empty.container, "empty"); // Rename into "empty" + + // FIXME: needs actuall logic + self.stack.set_visible_child_name("fb_parent") } fn init(&self) { diff --git a/hammond-gtk/src/main.rs b/hammond-gtk/src/main.rs index 0499015..fd0a024 100644 --- a/hammond-gtk/src/main.rs +++ b/hammond-gtk/src/main.rs @@ -50,7 +50,7 @@ mod content; mod utils; mod static_resource; -use views::podcasts; +// use views::podcasts; /* THIS IS STILL A PROTOTYPE. @@ -66,7 +66,9 @@ fn build_ui(app: >k::Application) { let window = gtk::ApplicationWindow::new(app); window.set_default_size(1150, 650); // Setup the Stack that will manage the switch between podcasts_view and podcast_widget. - let stack = podcasts::setup_stack(); + // let stack = podcasts::setup_stack(); + let content = content::Content::new(); + let stack = content.stack.clone(); window.add(&stack); window.connect_delete_event(|w, _| {