diff options
author | António Fernandes <antoniof@gnome.org> | 2021-11-25 19:46:20 +0000 |
---|---|---|
committer | António Fernandes <antoniof@gnome.org> | 2021-12-06 00:27:15 +0000 |
commit | 54617c32b33b052acebc1308e1b020e437493087 (patch) | |
tree | 790c71bc7c439a68bcfd321d4914ad0fad773dc3 | |
parent | c1760ff543822851719b82702de22fc577f9b8ae (diff) | |
download | nautilus-54617c32b33b052acebc1308e1b020e437493087.tar.gz |
extensions/image-properties: Reduce container API
Preparing for GTK4.
-rw-r--r-- | extensions/image-properties/nautilus-image-properties-page.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/extensions/image-properties/nautilus-image-properties-page.c b/extensions/image-properties/nautilus-image-properties-page.c index 345e85791..86d4ce9cd 100644 --- a/extensions/image-properties/nautilus-image-properties-page.c +++ b/extensions/image-properties/nautilus-image-properties-page.c @@ -68,7 +68,7 @@ append_item (NautilusImagesPropertiesPage *page, pango_attr_list_insert (attrs, pango_attr_weight_new (PANGO_WEIGHT_BOLD)); gtk_label_set_attributes (GTK_LABEL (name_label), attrs); pango_attr_list_unref (attrs); - gtk_container_add (GTK_CONTAINER (page->grid), name_label); + gtk_grid_attach_next_to (GTK_GRID (page->grid), name_label, NULL, GTK_POS_BOTTOM, 1, 1); gtk_widget_set_halign (name_label, GTK_ALIGN_START); gtk_widget_show (name_label); @@ -110,7 +110,12 @@ nautilus_image_properties_page_init (NautilusImagesPropertiesPage *self) gtk_grid_set_row_spacing (GTK_GRID (self->grid), 6); gtk_grid_set_column_spacing (GTK_GRID (self->grid), 18); append_item (self, _("Loading…"), NULL); +#if GTK_MAJOR_VERSION < 4 gtk_container_add (GTK_CONTAINER (self->page_widget), self->grid); +#else + gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (self->page_widget), + self->grid); +#endif gtk_widget_show_all (GTK_WIDGET (self->page_widget)); } @@ -262,7 +267,7 @@ load_finished (NautilusImagesPropertiesPage *page) GtkWidget *label; label = gtk_grid_get_child_at (GTK_GRID (page->grid), 0, 0); - gtk_container_remove (GTK_CONTAINER (page->grid), label); + gtk_widget_hide (label); if (page->loader != NULL) { |