From 0c1e759a45aa0ebe38c6420e1283c842ddf7f5cd Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Fri, 15 Dec 2017 12:27:30 +0200 Subject: [PATCH] Dim out secondary label of EpisodeWidget. --- hammond-gtk/resources/gtk/episode_widget.ui | 12 +++++++++--- hammond-gtk/src/widgets/episode.rs | 17 ++++++++++++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/hammond-gtk/resources/gtk/episode_widget.ui b/hammond-gtk/resources/gtk/episode_widget.ui index 2e7558e..4669fd1 100644 --- a/hammond-gtk/resources/gtk/episode_widget.ui +++ b/hammond-gtk/resources/gtk/episode_widget.ui @@ -6,6 +6,7 @@ True False vertical + 5 True @@ -27,7 +28,6 @@ False start Episode Title - True True end False @@ -56,6 +56,7 @@ True False 1970/01/01 + True False @@ -65,10 +66,11 @@ - + False True · + False False @@ -81,6 +83,7 @@ False True 42 min + True False @@ -90,10 +93,11 @@ - + True False · + False False @@ -106,6 +110,7 @@ True False 42 MB + True False @@ -119,6 +124,7 @@ False True 12 MB / 42 MB + True False diff --git a/hammond-gtk/src/widgets/episode.rs b/hammond-gtk/src/widgets/episode.rs index 54d2620..6047602 100644 --- a/hammond-gtk/src/widgets/episode.rs +++ b/hammond-gtk/src/widgets/episode.rs @@ -65,6 +65,22 @@ impl EpisodeWidget { let size: gtk::Label = builder.get_object("size_label").unwrap(); let progress_label: gtk::Label = builder.get_object("progress_label").unwrap(); + let sep1: gtk::Label = builder.get_object("seperator1").unwrap(); + let sep2: gtk::Label = builder.get_object("seperator2").unwrap(); + + // Dim(grey out) the labels. + // If it's possible through glade, feel free to open a PR. + duration + .get_style_context() + .map(|c| c.add_class("dim-label")); + progress_label + .get_style_context() + .map(|c| c.add_class("dim-label")); + date.get_style_context().map(|c| c.add_class("dim-label")); + size.get_style_context().map(|c| c.add_class("dim-label")); + sep1.get_style_context().map(|c| c.add_class("dim-label")); + sep2.get_style_context().map(|c| c.add_class("dim-label")); + EpisodeWidget { container, progress, @@ -92,7 +108,6 @@ impl EpisodeWidget { fn init(&self, episode: &mut EpisodeWidgetQuery, pd: &Podcast) { self.title.set_xalign(0.0); self.title.set_text(episode.title()); - self.progress.set_pulse_step(0.1); let progress = self.progress.clone(); timeout_add(200, move || {