ShowsView: Remove new_episodes indicator.

This commit is contained in:
Jordan Petridis 2017-12-17 15:34:34 +02:00
parent 3cbda5979d
commit 0826514cbc
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6
3 changed files with 5 additions and 63 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 943 B

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.1 -->
<!-- Generated with glade 3.20.2 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkBox" id="fb_child">
@ -23,42 +23,11 @@
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="stock">gtk-missing-image</property>
<property name="use_fallback">True</property>
<property name="icon_size">6</property>
<property name="pixel_size">256</property>
<property name="icon_name">image-x-generic-symbolic</property>
<property name="icon_size">0</property>
</object>
</child>
<child type="overlay">
<object class="GtkImage" id="banner">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="halign">end</property>
<property name="valign">start</property>
<property name="stock">gtk-missing-image</property>
</object>
<packing>
<property name="index">1</property>
</packing>
</child>
<child type="overlay">
<object class="GtkLabel" id="banner_label">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="halign">end</property>
<property name="valign">start</property>
<property name="margin_right">40</property>
<property name="margin_top">38</property>
<property name="label" translatable="yes">Num</property>
<property name="use_markup">True</property>
<property name="justify">center</property>
<property name="track_visited_links">False</property>
<property name="xalign">1</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="index">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
@ -72,12 +41,12 @@
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="label" translatable="yes">label</property>
<property name="use_markup">True</property>
<property name="justify">center</property>
<property name="ellipsize">end</property>
<property name="single_line_mode">True</property>
<property name="max_width_chars">33</property>
<property name="track_visited_links">False</property>
</object>
<packing>
<property name="expand">False</property>

View File

@ -1,6 +1,5 @@
use gtk;
use gtk::prelude::*;
use gdk_pixbuf::Pixbuf;
use diesel::associations::Identifiable;
use hammond_data::dbqueries;
@ -82,8 +81,6 @@ struct ShowsChild {
container: gtk::Box,
title: gtk::Label,
cover: gtk::Image,
banner: gtk::Image,
number: gtk::Label,
child: gtk::FlowBoxChild,
}
@ -94,8 +91,6 @@ impl Default for ShowsChild {
let container: gtk::Box = builder.get_object("fb_child").unwrap();
let title: gtk::Label = builder.get_object("pd_title").unwrap();
let cover: gtk::Image = builder.get_object("pd_cover").unwrap();
let banner: gtk::Image = builder.get_object("banner").unwrap();
let number: gtk::Label = builder.get_object("banner_label").unwrap();
let child = gtk::FlowBoxChild::new();
child.add(&container);
@ -104,8 +99,6 @@ impl Default for ShowsChild {
container,
title,
cover,
banner,
number,
child,
}
}
@ -115,7 +108,6 @@ impl ShowsChild {
pub fn new(pd: &Podcast) -> ShowsChild {
let child = ShowsChild::default();
child.init(pd);
child
}
@ -128,24 +120,5 @@ impl ShowsChild {
};
WidgetExt::set_name(&self.child, &pd.id().to_string());
self.configure_banner(pd);
}
fn configure_banner(&self, pd: &Podcast) {
let bann =
Pixbuf::new_from_resource_at_scale("/org/gnome/hammond/banner.png", 256, 256, true);
if let Ok(b) = bann {
self.banner.set_from_pixbuf(&b);
let new_episodes = dbqueries::get_pd_unplayed_episodes(pd);
if let Ok(n) = new_episodes {
if !n.is_empty() {
self.number.set_text(&n.len().to_string());
self.banner.show();
self.number.show();
}
}
}
}
}