EpisodesView: Added glade files and initial yak shaving.
This commit is contained in:
@@ -6,6 +6,7 @@ use hammond_data::dbqueries;
|
||||
|
||||
use views::shows::ShowsPopulated;
|
||||
use views::empty::EmptyView;
|
||||
use views::episodes::EpisodesView;
|
||||
|
||||
use widgets::show::ShowWidget;
|
||||
use headerbar::Header;
|
||||
@@ -155,14 +156,14 @@ struct EpisodeStack {
|
||||
|
||||
impl EpisodeStack {
|
||||
fn new() -> Rc<EpisodeStack> {
|
||||
let _pop = RecentEpisodes {};
|
||||
let episodes = EpisodesView::default();
|
||||
let empty = EmptyView::new();
|
||||
let stack = gtk::Stack::new();
|
||||
|
||||
// stack.add_named(&pop.container, "populated");
|
||||
stack.add_named(&episodes.container, "episodes");
|
||||
stack.add_named(&empty.container, "empty");
|
||||
// FIXME:
|
||||
stack.set_visible_child_name("empty");
|
||||
stack.set_visible_child_name("episodes");
|
||||
|
||||
Rc::new(EpisodeStack {
|
||||
// empty,
|
||||
|
||||
@@ -1 +1,47 @@
|
||||
use gtk;
|
||||
use gtk::prelude::*;
|
||||
|
||||
use widgets::episode::EpisodeWidget;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct EpisodesView {
|
||||
pub container: gtk::Box,
|
||||
frame_parent: gtk::Box,
|
||||
}
|
||||
|
||||
impl Default for EpisodesView {
|
||||
fn default() -> Self {
|
||||
let builder = gtk::Builder::new_from_resource("/org/gnome/hammond/gtk/episodes_view.ui");
|
||||
let container: gtk::Box = builder.get_object("container").unwrap();
|
||||
let frame_parent: gtk::Box = builder.get_object("frame_parent").unwrap();
|
||||
|
||||
EpisodesView {
|
||||
container,
|
||||
frame_parent,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
struct EpisodesViewWidget {
|
||||
container: gtk::Box,
|
||||
image: gtk::Image,
|
||||
episode: gtk::Box,
|
||||
}
|
||||
|
||||
impl Default for EpisodesViewWidget {
|
||||
fn default() -> Self {
|
||||
let builder =
|
||||
gtk::Builder::new_from_resource("/org/gnome/hammond/gtk/episodes_view_widget.ui");
|
||||
let container: gtk::Box = builder.get_object("container").unwrap();
|
||||
let image: gtk::Image = builder.get_object("cover").unwrap();
|
||||
let ep = EpisodeWidget::default();
|
||||
container.add(&ep.container);
|
||||
|
||||
EpisodesViewWidget {
|
||||
container,
|
||||
image,
|
||||
episode: ep.container,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,9 +32,9 @@ type Foo = RefCell<
|
||||
|
||||
thread_local!(static GLOBAL: Foo = RefCell::new(None));
|
||||
|
||||
#[derive(Debug)]
|
||||
struct EpisodeWidget {
|
||||
container: gtk::Box,
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct EpisodeWidget {
|
||||
pub container: gtk::Box,
|
||||
play: gtk::Button,
|
||||
delete: gtk::Button,
|
||||
download: gtk::Button,
|
||||
|
||||
@@ -40,10 +40,6 @@ impl Default for ShowWidget {
|
||||
let link: gtk::Button = builder.get_object("link_button").unwrap();
|
||||
let settings: gtk::MenuButton = builder.get_object("settings_button").unwrap();
|
||||
|
||||
unsub
|
||||
.get_style_context()
|
||||
.map(|c| c.add_class("destructive-action"));
|
||||
|
||||
ShowWidget {
|
||||
container,
|
||||
cover,
|
||||
|
||||
Reference in New Issue
Block a user