podcasts/podcasts-gtk/src/widgets/empty.rs
Jordan Petridis 569c00ff5f
Allow for parallel development instance
This adds a configuration option in meson, if set it changes the
application ID allowing for stable and development version to be
run at the same time.
2018-08-28 17:22:13 +03:00

42 lines
1.1 KiB
Rust

use app::APP_ID;
use gtk::{self, prelude::*};
use std::ops::Deref;
#[derive(Clone, Debug)]
pub(crate) struct EmptyView(gtk::Box);
impl Deref for EmptyView {
type Target = gtk::Box;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl Default for EmptyView {
fn default() -> Self {
let builder = gtk::Builder::new_from_resource("/org/gnome/Podcasts/gtk/empty_view.ui");
let view: gtk::Box = builder.get_object("empty_view").unwrap();
let image: gtk::Image = builder.get_object("image").unwrap();
image.set_from_icon_name(format!("{}-symbolic", APP_ID).as_str(), 256);
EmptyView(view)
}
}
#[derive(Clone, Debug)]
pub(crate) struct EmptyShow(gtk::Box);
impl Deref for EmptyShow {
type Target = gtk::Box;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl Default for EmptyShow {
fn default() -> Self {
let builder = gtk::Builder::new_from_resource("/org/gnome/Podcasts/gtk/empty_view.ui");
let box_: gtk::Box = builder.get_object("empty_show").unwrap();
EmptyShow(box_)
}
}