[nautilus/wip/antoniof/experimental-gtk4-build: 49/52] view-icon-item-ui: Use GtkPicture instead of GtkImage




commit 7b3125adc789ee61c8b5d6681b62c557f8ac03f9
Author: António Fernandes <antoniof gnome org>
Date:   Fri Dec 24 00:07:17 2021 +0000

    view-icon-item-ui: Use GtkPicture instead of GtkImage
    
    GtkImage is simpler now, with only 2 available sizes. We need to use the
    new GtkPicture instead to restore the expected icon sizes. It can grow
    to fill the space available to fit the intrinsic size of the image.

 src/nautilus-view-icon-item-ui.c               | 2 +-
 src/resources/ui/nautilus-view-icon-item-ui.ui | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-view-icon-item-ui.c b/src/nautilus-view-icon-item-ui.c
index 344e0fc2a..8bb1e2abe 100644
--- a/src/nautilus-view-icon-item-ui.c
+++ b/src/nautilus-view-icon-item-ui.c
@@ -47,7 +47,7 @@ update_icon (NautilusViewIconItemUi *self)
             NAUTILUS_FILE_ICON_FLAGS_USE_ONE_EMBLEM;
 
     icon_paintable = nautilus_file_get_icon_paintable (file, icon_size, 1, flags);
-    gtk_image_set_from_paintable (GTK_IMAGE (self->icon), icon_paintable);
+    gtk_picture_set_paintable (GTK_PICTURE (self->icon), icon_paintable);
 
     gtk_widget_set_size_request (self->fixed_height_box, icon_size, icon_size);
     if (icon_size < NAUTILUS_GRID_ICON_SIZE_LARGEST)
diff --git a/src/resources/ui/nautilus-view-icon-item-ui.ui b/src/resources/ui/nautilus-view-icon-item-ui.ui
index fa1fe25e1..624a5a178 100644
--- a/src/resources/ui/nautilus-view-icon-item-ui.ui
+++ b/src/resources/ui/nautilus-view-icon-item-ui.ui
@@ -17,11 +17,12 @@
             <property name="valign">center</property>
             <property name="width-request">96</property>
             <child>
-              <object class="GtkImage" id="icon">
+              <object class="GtkPicture" id="icon">
                 <property name="halign">center</property>
                 <property name="hexpand">True</property>
                 <property name="valign">end</property>
                 <property name="vexpand">True</property>
+                <property name="can-shrink">False</property>
               </object>
             </child>
           </object>


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