diff --git a/podcasts-gtk/resources/gtk/shows_child.ui b/podcasts-gtk/resources/gtk/shows_child.ui deleted file mode 100644 index 1a7d5fd..0000000 --- a/podcasts-gtk/resources/gtk/shows_child.ui +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - 256 - 256 - True - False - center - center - vertical - - - True - False - center - center - 256 - image-x-generic-symbolic - 0 - - - False - True - 0 - - - - diff --git a/podcasts-gtk/resources/resources.xml b/podcasts-gtk/resources/resources.xml index b67f496..e04850a 100644 --- a/podcasts-gtk/resources/resources.xml +++ b/podcasts-gtk/resources/resources.xml @@ -7,7 +7,6 @@ gtk/empty_show.ui gtk/home_view.ui gtk/home_episode.ui - gtk/shows_child.ui gtk/headerbar.ui gtk/inapp_notif.ui gtk/hamburger.ui diff --git a/podcasts-gtk/src/widgets/shows_view.rs b/podcasts-gtk/src/widgets/shows_view.rs index db31c74..6ebdcbb 100644 --- a/podcasts-gtk/src/widgets/shows_view.rs +++ b/podcasts-gtk/src/widgets/shows_view.rs @@ -140,28 +140,22 @@ fn on_child_activate(child: >k::FlowBoxChild, sender: &Sender) -> Resu Ok(()) } -#[derive(Debug)] +#[derive(Debug, Clone)] struct ShowsChild { - container: gtk::Box, cover: gtk::Image, child: gtk::FlowBoxChild, } impl Default for ShowsChild { fn default() -> Self { - let builder = gtk::Builder::new_from_resource("/org/gnome/Podcasts/gtk/shows_child.ui"); - - let container: gtk::Box = builder.get_object("fb_child").unwrap(); - let cover: gtk::Image = builder.get_object("pd_cover").unwrap(); - + let cover = gtk::Image::new_from_icon_name("image-x-generic-symbolic", -1); let child = gtk::FlowBoxChild::new(); - child.add(&container); - ShowsChild { - container, - cover, - child, - } + cover.set_pixel_size(256); + child.add(&cover); + child.show_all(); + + ShowsChild { cover, child } } } @@ -173,7 +167,7 @@ impl ShowsChild { } fn init(&self, pd: &Show) { - self.container.set_tooltip_text(pd.title()); + self.child.set_tooltip_text(pd.title()); WidgetExt::set_name(&self.child, &pd.id().to_string()); self.set_cover(pd.id())