| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
use crate::config::APP_ID; |
| 21 |
|
| 22 |
use adw::subclass::prelude::*; |
| 23 |
use gtk::{CompositeTemplate, glib}; |
| 24 |
|
| 25 |
#[derive(Debug, CompositeTemplate)] |
| 26 |
#[template(resource = "/org/gnome/Podcasts/gtk/empty_view.ui")] |
| 27 |
pub struct EmptyViewPriv { |
| 28 |
#[template_child] |
| 29 |
pub status_page: TemplateChild<adw::StatusPage>, |
| 30 |
} |
| 31 |
|
| 32 |
#[glib::object_subclass] |
| 33 |
impl ObjectSubclass for EmptyViewPriv { |
| 34 |
const NAME: &'static str = "PdEmptyView"; |
| 35 |
type Type = EmptyView; |
| 36 |
type ParentType = adw::Bin; |
| 37 |
|
| 38 |
fn new() -> Self { |
| 39 |
Self { |
| 40 |
status_page: TemplateChild::default(), |
| 41 |
} |
| 42 |
} |
| 43 |
|
| 44 |
fn class_init(klass: &mut Self::Class) { |
| 45 |
klass.bind_template(); |
| 46 |
} |
| 47 |
|
| 48 |
|
| 49 |
fn instance_init(obj: &glib::subclass::InitializingObject<Self>) { |
| 50 |
obj.init_template(); |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
impl ObjectImpl for EmptyViewPriv { |
| 55 |
fn constructed(&self) { |
| 56 |
self.parent_constructed(); |
| 57 |
self.status_page.set_icon_name(Some(APP_ID)); |
| 58 |
} |
| 59 |
} |
| 60 |
|
| 61 |
impl WidgetImpl for EmptyViewPriv {} |
| 62 |
impl BinImpl for EmptyViewPriv {} |
| 63 |
|
| 64 |
glib::wrapper! { |
| 65 |
pub struct EmptyView(ObjectSubclass<EmptyViewPriv>) |
| 66 |
@extends gtk::Widget, adw::Bin, |
| 67 |
@implements gtk::ConstraintTarget, gtk::Buildable, gtk::Accessible; |
| 68 |
} |
| 69 |
|
| 70 |
impl Default for EmptyView { |
| 71 |
fn default() -> Self { |
| 72 |
glib::Object::new() |
| 73 |
} |
| 74 |
} |