[nautilus/wip/antoniof/experimental-gtk4-build: 30/52] GtkContainer never dies




commit 50f8eb40f635f8317cf705de9566dbeb2e420e34
Author: António Fernandes <antoniof gnome org>
Date:   Fri Dec 24 01:09:11 2021 +0000

    GtkContainer never dies

 src/nautilus-notebook.c             | 10 +++++-----
 src/nautilus-properties-window.c    |  8 ++++----
 src/nautilus-view-icon-controller.c |  5 +++--
 3 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/src/nautilus-notebook.c b/src/nautilus-notebook.c
index e5bc14d53..494ef8ed1 100644
--- a/src/nautilus-notebook.c
+++ b/src/nautilus-notebook.c
@@ -314,11 +314,11 @@ nautilus_notebook_add_tab (GtkNotebook        *notebook,
                                          tab_label,
                                          position);
 
-    gtk_container_child_set (GTK_CONTAINER (notebook),
-                             GTK_WIDGET (slot),
-                             "tab-expand", TRUE,
-                             "detachable", FALSE,
-                             NULL);
+    g_object_set (gtk_notebook_get_page (GTK_NOTEBOOK (notebook),
+                                         GTK_WIDGET (slot)),
+                  "tab-expand", TRUE,
+                  "detachable", FALSE,
+                  NULL);
 
     nautilus_notebook_sync_tab_label (notebook, slot);
     nautilus_notebook_sync_loading (notebook, slot);
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index d3718434d..b3f02b3ac 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -4226,10 +4226,10 @@ append_extension_pages (NautilusPropertiesWindow *self)
 
             gtk_notebook_append_page (self->notebook,
                                       page_widget, label);
-            gtk_container_child_set (GTK_CONTAINER (self->notebook),
-                                     page_widget,
-                                     "tab-expand", TRUE,
-                                     NULL);
+            g_object_set (gtk_notebook_get_page (GTK_NOTEBOOK (self->notebook),
+                                                 GTK_WIDGET (page_widget)),
+                          "tab-expand", TRUE,
+                          NULL);
 
             g_object_set_data (G_OBJECT (page_widget),
                                "is-extension-page",
diff --git a/src/nautilus-view-icon-controller.c b/src/nautilus-view-icon-controller.c
index bad69ed7a..ffd12e432 100644
--- a/src/nautilus-view-icon-controller.c
+++ b/src/nautilus-view-icon-controller.c
@@ -717,7 +717,7 @@ real_reveal_for_selection_context_menu (NautilusFilesView *files_view)
 
     /* Get the focused item_ui, if selected.
      * Otherwise, get the selected item_ui which is sorted the lowest.*/
-    item_ui = gtk_container_get_focus_child (GTK_CONTAINER (self->view_ui));
+    item_ui = gtk_widget_get_focus_child (GTK_WIDGET (self->view_ui));
     if (item_ui == NULL || !gtk_flow_box_child_is_selected (GTK_FLOW_BOX_CHILD (item_ui)))
     {
         g_autoptr (GList) list = gtk_flow_box_get_selected_children (self->view_ui);
@@ -1406,7 +1406,8 @@ constructed (GObject *object)
     g_signal_connect (controller, "pressed",
                       (GCallback) on_longpress_gesture_pressed_callback, self);
 
-    gtk_container_add (GTK_CONTAINER (content_widget), GTK_WIDGET (self->view_ui));
+    gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (content_widget),
+                                   GTK_WIDGET (self->view_ui));
 
     self->action_group = nautilus_files_view_get_action_group (NAUTILUS_FILES_VIEW (self));
     g_action_map_add_action_entries (G_ACTION_MAP (self->action_group),


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