h-gtk: Rename EpisodeStack to HomeStack.

This commit is contained in:
Jordan Petridis 2018-04-24 09:31:56 +03:00
parent d7aec6fdfb
commit 75af3c7f2b
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6
3 changed files with 9 additions and 10 deletions

View File

@ -4,8 +4,7 @@ use gtk::prelude::*;
use failure::Error;
use app::Action;
use stacks::EpisodeStack;
use stacks::ShowStack;
use stacks::{HomeStack, ShowStack};
use std::cell::RefCell;
use std::rc::Rc;
@ -15,14 +14,14 @@ use std::sync::mpsc::Sender;
pub struct Content {
stack: gtk::Stack,
shows: Rc<RefCell<ShowStack>>,
episodes: Rc<RefCell<EpisodeStack>>,
episodes: Rc<RefCell<HomeStack>>,
sender: Sender<Action>,
}
impl Content {
pub fn new(sender: Sender<Action>) -> Result<Content, Error> {
let stack = gtk::Stack::new();
let episodes = Rc::new(RefCell::new(EpisodeStack::new(sender.clone())?));
let episodes = Rc::new(RefCell::new(HomeStack::new(sender.clone())?));
let shows = Rc::new(RefCell::new(ShowStack::new(sender.clone())?));
stack.add_titled(&episodes.borrow().get_stack(), "episodes", "Episodes");

View File

@ -12,15 +12,15 @@ use std::rc::Rc;
use std::sync::mpsc::Sender;
#[derive(Debug, Clone)]
pub struct EpisodeStack {
pub struct HomeStack {
stack: gtk::Stack,
empty: EmptyView,
episodes: Rc<HomeView>,
sender: Sender<Action>,
}
impl EpisodeStack {
pub fn new(sender: Sender<Action>) -> Result<EpisodeStack, Error> {
impl HomeStack {
pub fn new(sender: Sender<Action>) -> Result<HomeStack, Error> {
let episodes = HomeView::new(sender.clone())?;
let empty = EmptyView::new();
let stack = gtk::Stack::new();
@ -29,7 +29,7 @@ impl EpisodeStack {
stack.add_named(&empty.container, "empty");
set_stack_visible(&stack)?;
Ok(EpisodeStack {
Ok(HomeStack {
stack,
empty,
episodes,

View File

@ -1,7 +1,7 @@
mod content;
mod episode;
mod home;
mod show;
pub use self::content::Content;
pub use self::episode::EpisodeStack;
pub use self::home::HomeStack;
pub use self::show::ShowStack;