Use content struct instead of plain stack.

This commit is contained in:
Jordan Petridis 2017-12-01 01:30:19 +02:00
parent 5414dbdb37
commit b4b2f24c77
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6
3 changed files with 8 additions and 3 deletions

View File

@ -12,7 +12,7 @@
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="shadow_type">in</property> <property name="shadow_type">in</property>
<child> <child>
<object class="GtkViewport"> <object class="GtkViewport" id="viewport">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>

View File

@ -55,6 +55,9 @@ impl Content {
self.stack.add_named(&self.widget.container, "pdw"); // Rename into "widget" 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.podcasts.container, "fb_parent"); // Rename into "podcasts"
self.stack.add_named(&self.empty.container, "empty"); // Rename into "empty" 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) { fn init(&self) {

View File

@ -50,7 +50,7 @@ mod content;
mod utils; mod utils;
mod static_resource; mod static_resource;
use views::podcasts; // use views::podcasts;
/* /*
THIS IS STILL A PROTOTYPE. THIS IS STILL A PROTOTYPE.
@ -66,7 +66,9 @@ fn build_ui(app: &gtk::Application) {
let window = gtk::ApplicationWindow::new(app); let window = gtk::ApplicationWindow::new(app);
window.set_default_size(1150, 650); window.set_default_size(1150, 650);
// Setup the Stack that will manage the switch between podcasts_view and podcast_widget. // 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.add(&stack);
window.connect_delete_event(|w, _| { window.connect_delete_event(|w, _| {