[fractal/bilelmoussaoui/bump-gtk-rs: 5/11] column: libhandy::Column is now a proper Container




commit 2ae4883313648638cdfa0f72c002156c1f08def9
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Wed Jul 15 19:01:59 2020 +0200

    column: libhandy::Column is now a proper Container
    
    no need to cast it as a GtkContainer anymore

 fractal-gtk/src/app/connect/directory.rs    | 6 ------
 fractal-gtk/src/widgets/scroll_widget.rs    | 4 ----
 fractal-gtk/src/widgets/sourceview_entry.rs | 7 -------
 3 files changed, 17 deletions(-)
---
diff --git a/fractal-gtk/src/app/connect/directory.rs b/fractal-gtk/src/app/connect/directory.rs
index 1ea4fbb1..3fa88817 100644
--- a/fractal-gtk/src/app/connect/directory.rs
+++ b/fractal-gtk/src/app/connect/directory.rs
@@ -26,10 +26,6 @@ impl App {
         let listbox = gtk::ListBox::new();
 
         column.set_maximum_width(800);
-        /* 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::<gtk::Widget>();
-        let column = column.downcast::<gtk::Container>().unwrap();
         column.set_hexpand(true);
         column.set_vexpand(true);
         column.set_margin_top(24);
@@ -46,8 +42,6 @@ impl App {
         column.show();
         directory_stack.add_named(&column, "directory_column");
 
-        let column = column.upcast::<gtk::Widget>();
-        let column = column.downcast::<Column>().unwrap();
         self.ui
             .builder
             .expose_object::<gtk::ListBox>("directory_room_list", &listbox);
diff --git a/fractal-gtk/src/widgets/scroll_widget.rs b/fractal-gtk/src/widgets/scroll_widget.rs
index f667e8b8..8f9bbc12 100644
--- a/fractal-gtk/src/widgets/scroll_widget.rs
+++ b/fractal-gtk/src/widgets/scroll_widget.rs
@@ -62,10 +62,6 @@ impl Widgets {
         let column = libhandy::Column::new();
         column.set_maximum_width(800);
         column.set_linear_growth_width(600);
-        /* 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::<gtk::Widget>();
-        let column = column.downcast::<gtk::Container>().unwrap();
         column.set_hexpand(true);
         column.set_vexpand(true);
 
diff --git a/fractal-gtk/src/widgets/sourceview_entry.rs b/fractal-gtk/src/widgets/sourceview_entry.rs
index f7eb9526..acbb5f86 100644
--- a/fractal-gtk/src/widgets/sourceview_entry.rs
+++ b/fractal-gtk/src/widgets/sourceview_entry.rs
@@ -23,10 +23,6 @@ impl Default for SVEntry {
         let column = Column::new();
         column.set_maximum_width(800);
         column.set_linear_growth_width(600);
-        /* 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::<gtk::Widget>();
-        let column = column.downcast::<gtk::Container>().unwrap();
         column.set_vexpand(false);
 
         let container = gtk::Box::new(gtk::Orientation::Horizontal, 6);
@@ -99,9 +95,6 @@ impl Default for SVEntry {
         column.add(&container);
         column.show_all();
 
-        let column = column.upcast::<gtk::Widget>();
-        let column = column.downcast::<Column>().unwrap();
-
         SVEntry {
             column,
             container,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]