From fac048a24d56b471352c6ff185c3d9fe813deb80 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Fri, 22 Dec 2017 20:47:37 +0200 Subject: [PATCH 1/3] Small Visual tweaks all over the client. --- .gitlab-ci.yml | 1 + hammond-gtk/resources/gtk/episode_widget.ui | 16 ++++++++-------- hammond-gtk/resources/gtk/episodes_view.ui | 9 ++++++++- hammond-gtk/resources/gtk/show_widget.ui | 6 +++--- hammond-gtk/resources/gtk/shows_view.ui | 6 ++++-- 5 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1ae8422..63dd6f7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,6 +28,7 @@ before_script: variables: # RUSTFLAGS: "-C link-dead-code" RUST_BACKTRACE: "FULL" + CARGO_HOME: $CI_PROJECT_DIR/cargo stable:test: # https://hub.docker.com/_/rust/ diff --git a/hammond-gtk/resources/gtk/episode_widget.ui b/hammond-gtk/resources/gtk/episode_widget.ui index b0332fc..f6dd911 100644 --- a/hammond-gtk/resources/gtk/episode_widget.ui +++ b/hammond-gtk/resources/gtk/episode_widget.ui @@ -10,14 +10,14 @@ True False - 5 + 6 True False center vertical - 5 + 6 True @@ -51,7 +51,7 @@ True False - 5 + 6 True @@ -164,7 +164,7 @@ False True - 5 + 6 0 @@ -172,7 +172,7 @@ True False - 5 + 6 Cancel @@ -260,7 +260,7 @@ False True - 5 + 6 end 1 @@ -269,7 +269,7 @@ True False - 5 + 6 0 @@ -281,7 +281,7 @@ False True - 5 + 6 end 1 diff --git a/hammond-gtk/resources/gtk/episodes_view.ui b/hammond-gtk/resources/gtk/episodes_view.ui index 9df8483..1d5333f 100644 --- a/hammond-gtk/resources/gtk/episodes_view.ui +++ b/hammond-gtk/resources/gtk/episodes_view.ui @@ -41,14 +41,16 @@ True False center + 24 vertical - 25 + 24 True False True vertical + 6 True @@ -102,6 +104,7 @@ False True vertical + 6 True @@ -155,6 +158,7 @@ False True vertical + 6 True @@ -208,6 +212,7 @@ False True vertical + 6 True @@ -261,6 +266,7 @@ False True vertical + 6 True @@ -314,6 +320,7 @@ False True vertical + 6 True diff --git a/hammond-gtk/resources/gtk/show_widget.ui b/hammond-gtk/resources/gtk/show_widget.ui index ead850a..0f83b05 100644 --- a/hammond-gtk/resources/gtk/show_widget.ui +++ b/hammond-gtk/resources/gtk/show_widget.ui @@ -58,7 +58,7 @@ True False center - 10 + 12 True @@ -77,7 +77,7 @@ True False vertical - 10 + 12 True @@ -191,7 +191,7 @@ False True - 25 + 24 0 diff --git a/hammond-gtk/resources/gtk/shows_view.ui b/hammond-gtk/resources/gtk/shows_view.ui index 7981cb9..5050ca0 100644 --- a/hammond-gtk/resources/gtk/shows_view.ui +++ b/hammond-gtk/resources/gtk/shows_view.ui @@ -21,9 +21,11 @@ False center start + 24 + 24 True - 5 - 5 + 12 + 12 20 none From ae6a97d7256d3f9d45ff8b55cdfcdbf94384bf17 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Fri, 22 Dec 2017 21:21:39 +0200 Subject: [PATCH 2/3] EpisodesViewWidget: Add margins from the cover. --- hammond-gtk/resources/gtk/episodes_view_widget.ui | 4 ++++ hammond-gtk/src/views/episodes.rs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hammond-gtk/resources/gtk/episodes_view_widget.ui b/hammond-gtk/resources/gtk/episodes_view_widget.ui index 3aa6d88..bbe09b7 100644 --- a/hammond-gtk/resources/gtk/episodes_view_widget.ui +++ b/hammond-gtk/resources/gtk/episodes_view_widget.ui @@ -5,10 +5,14 @@ True False + 6 True False + 6 + 6 + 6 64 image-x-generic-symbolic diff --git a/hammond-gtk/src/views/episodes.rs b/hammond-gtk/src/views/episodes.rs index f1930c5..a388b3a 100644 --- a/hammond-gtk/src/views/episodes.rs +++ b/hammond-gtk/src/views/episodes.rs @@ -207,7 +207,7 @@ impl Default for EpisodesViewWidget { let container: gtk::Box = builder.get_object("container").unwrap(); let image: gtk::Image = builder.get_object("cover").unwrap(); let ep = EpisodeWidget::default(); - container.pack_start(&ep.container, true, true, 5); + container.pack_start(&ep.container, true, true, 6); EpisodesViewWidget { container, @@ -233,7 +233,7 @@ impl EpisodesViewWidget { } let ep = EpisodeWidget::new(episode); - container.pack_start(&ep.container, true, true, 5); + container.pack_start(&ep.container, true, true, 6); EpisodesViewWidget { container, From 832495beceb67972e3f7fa4e9db61ff06db3c00e Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Fri, 22 Dec 2017 22:14:08 +0200 Subject: [PATCH 3/3] EpisodesView: Remove Year category. --- hammond-gtk/resources/gtk/episodes_view.ui | 56 +--------------------- hammond-gtk/src/main.rs | 2 +- hammond-gtk/src/views/episodes.rs | 21 -------- 3 files changed, 2 insertions(+), 77 deletions(-) diff --git a/hammond-gtk/resources/gtk/episodes_view.ui b/hammond-gtk/resources/gtk/episodes_view.ui index 1d5333f..8a493c0 100644 --- a/hammond-gtk/resources/gtk/episodes_view.ui +++ b/hammond-gtk/resources/gtk/episodes_view.ui @@ -260,60 +260,6 @@ 3 - - - True - False - True - vertical - 6 - - - True - False - start - This Year - - - - - - - False - True - 0 - - - - - True - False - 0 - in - - - True - False - none - - - - - - - - False - True - 1 - - - - - False - True - 4 - - True @@ -326,7 +272,7 @@ True False start - Older than a Year + Older diff --git a/hammond-gtk/src/main.rs b/hammond-gtk/src/main.rs index 08bfeee..70f65f4 100644 --- a/hammond-gtk/src/main.rs +++ b/hammond-gtk/src/main.rs @@ -66,7 +66,7 @@ fn build_ui(app: >k::Application) { // Get the main window let window = gtk::ApplicationWindow::new(app); - window.set_default_size(1150, 650); + window.set_default_size(1024, 576); // Get the headerbar let header = Rc::new(headerbar::Header::default()); diff --git a/hammond-gtk/src/views/episodes.rs b/hammond-gtk/src/views/episodes.rs index a388b3a..915cac2 100644 --- a/hammond-gtk/src/views/episodes.rs +++ b/hammond-gtk/src/views/episodes.rs @@ -16,7 +16,6 @@ enum ListSplit { Yday, Week, Month, - Year, Rest, } @@ -28,13 +27,11 @@ pub struct EpisodesView { yday_box: gtk::Box, week_box: gtk::Box, month_box: gtk::Box, - year_box: gtk::Box, rest_box: gtk::Box, today_list: gtk::ListBox, yday_list: gtk::ListBox, week_list: gtk::ListBox, month_list: gtk::ListBox, - year_list: gtk::ListBox, rest_list: gtk::ListBox, } @@ -47,13 +44,11 @@ impl Default for EpisodesView { let yday_box: gtk::Box = builder.get_object("yday_box").unwrap(); let week_box: gtk::Box = builder.get_object("week_box").unwrap(); let month_box: gtk::Box = builder.get_object("month_box").unwrap(); - let year_box: gtk::Box = builder.get_object("year_box").unwrap(); let rest_box: gtk::Box = builder.get_object("rest_box").unwrap(); let today_list: gtk::ListBox = builder.get_object("today_list").unwrap(); let yday_list: gtk::ListBox = builder.get_object("yday_list").unwrap(); let week_list: gtk::ListBox = builder.get_object("week_list").unwrap(); let month_list: gtk::ListBox = builder.get_object("month_list").unwrap(); - let year_list: gtk::ListBox = builder.get_object("year_list").unwrap(); let rest_list: gtk::ListBox = builder.get_object("rest_list").unwrap(); EpisodesView { @@ -63,13 +58,11 @@ impl Default for EpisodesView { yday_box, week_box, month_box, - year_box, rest_box, today_list, yday_list, week_list, month_list, - year_list, rest_list, } } @@ -105,10 +98,6 @@ impl EpisodesView { view.month_list.add(&viewep.container); view.month_list.add(&sep) } - ListSplit::Year => { - view.year_list.add(&viewep.container); - view.year_list.add(&sep) - } ListSplit::Rest => { view.rest_list.add(&viewep.container); view.rest_list.add(&sep) @@ -134,10 +123,6 @@ impl EpisodesView { view.month_box.hide(); } - if view.year_list.get_children().is_empty() { - view.year_box.hide(); - } - if view.rest_list.get_children().is_empty() { view.rest_box.hide(); } @@ -163,10 +148,6 @@ impl EpisodesView { return false; } - if !self.year_list.get_children().is_empty() { - return false; - } - if !self.rest_list.get_children().is_empty() { return false; } @@ -186,8 +167,6 @@ fn split(now: &DateTime, epoch: i64) -> ListSplit { ListSplit::Week } else if now.month() == ep.month() && now.year() == ep.year() { ListSplit::Month - } else if now.year() == ep.year() { - ListSplit::Year } else { ListSplit::Rest }