From a62dfb87d822a91aa35e9bb5d7d8c41b2ec1234a Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Thu, 9 Aug 2018 04:54:06 +0300 Subject: [PATCH] HomeView: Use libhandy::Column for the main widget --- podcasts-gtk/src/widgets/home_view.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/podcasts-gtk/src/widgets/home_view.rs b/podcasts-gtk/src/widgets/home_view.rs index 3cdacd5..59878e9 100644 --- a/podcasts-gtk/src/widgets/home_view.rs +++ b/podcasts-gtk/src/widgets/home_view.rs @@ -6,6 +6,7 @@ use gtk::prelude::*; use crossbeam_channel::Sender; use fragile::Fragile; +use libhandy::{Column, ColumnExt}; use podcasts_data::dbqueries; use podcasts_data::EpisodeWidgetModel; @@ -63,7 +64,16 @@ impl Default for HomeView { let month_list: gtk::ListBox = builder.get_object("month_list").unwrap(); let rest_list: gtk::ListBox = builder.get_object("rest_list").unwrap(); - view.add(&frame_parent); + let column = Column::new(); + column.show(); + column.set_maximum_width(700); + // For some reason the Column is not seen as a gtk::container + // and therefore we can't call add() without the cast + let column = column.upcast::(); + let column = column.downcast::().unwrap(); + + column.add(&frame_parent); + view.add(&column); HomeView { view,