[nautilus/wip/antoniof/new-list-view: 9/12] files-view: Subclass AdwBin




commit ff6136b15bfdfa9293d6d6d3abd89c03e28bc799
Author: António Fernandes <antoniof gnome org>
Date:   Tue Mar 29 20:07:06 2022 +0100

    files-view: Subclass AdwBin
    
    Instead of GtkGrid. It has a single child anyway, a GtkOverlay.

 src/nautilus-files-view.c | 5 ++---
 src/nautilus-files-view.h | 4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index ef30c9139..4577b494a 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -352,7 +352,7 @@ static gboolean nautilus_files_view_is_read_only (NautilusFilesView *view);
 
 G_DEFINE_TYPE_WITH_CODE (NautilusFilesView,
                          nautilus_files_view,
-                         GTK_TYPE_GRID,
+                         ADW_TYPE_BIN,
                          G_IMPLEMENT_INTERFACE (NAUTILUS_TYPE_VIEW, nautilus_files_view_iface_init)
                          G_ADD_PRIVATE (NautilusFilesView));
 
@@ -9439,11 +9439,10 @@ nautilus_files_view_init (NautilusFilesView *view)
     g_object_unref (builder);
 
     /* Main widgets */
-    gtk_orientable_set_orientation (GTK_ORIENTABLE (view), GTK_ORIENTATION_VERTICAL);
     priv->overlay = gtk_overlay_new ();
     gtk_widget_set_vexpand (priv->overlay, TRUE);
     gtk_widget_set_hexpand (priv->overlay, TRUE);
-    gtk_grid_attach_next_to (GTK_GRID (view), priv->overlay, NULL, GTK_POS_BOTTOM, 1, 1);
+    adw_bin_set_child (ADW_BIN (view), priv->overlay);
     gtk_widget_show (priv->overlay);
 
     /* Scrolled Window */
diff --git a/src/nautilus-files-view.h b/src/nautilus-files-view.h
index e8e3d507c..0e1bd2e28 100644
--- a/src/nautilus-files-view.h
+++ b/src/nautilus-files-view.h
@@ -38,10 +38,10 @@ G_BEGIN_DECLS
 
 #define NAUTILUS_TYPE_FILES_VIEW nautilus_files_view_get_type()
 
-G_DECLARE_DERIVABLE_TYPE (NautilusFilesView, nautilus_files_view, NAUTILUS, FILES_VIEW, GtkGrid)
+G_DECLARE_DERIVABLE_TYPE (NautilusFilesView, nautilus_files_view, NAUTILUS, FILES_VIEW, AdwBin)
 
 struct _NautilusFilesViewClass {
-        GtkGridClass parent_class;
+        AdwBinClass parent_class;
 
         /* The 'clear' signal is emitted to empty the view of its contents.
          * It must be replaced by each subclass.


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