[nautilus/wip/antoniof/hidpi-and-icons-cleanup: 3/11] file-conflict-dialog: Use GtkPicture instead of GtkImage for icons




commit 8d60f1efbd84163c9d173cea84a7d7027ac1a9e1
Author: António Fernandes <antoniof gnome org>
Date:   Sun Aug 7 17:31:15 2022 +0100

    file-conflict-dialog: Use GtkPicture instead of GtkImage for icons
    
    Picture will automatically take the size of the paintable, while
    Image defaults to 16px.

 src/nautilus-file-conflict-dialog.c               | 12 ++++++------
 src/resources/ui/nautilus-file-conflict-dialog.ui |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/nautilus-file-conflict-dialog.c b/src/nautilus-file-conflict-dialog.c
index 327c5c69b..f7c3cc702 100644
--- a/src/nautilus-file-conflict-dialog.c
+++ b/src/nautilus-file-conflict-dialog.c
@@ -52,8 +52,8 @@ struct _NautilusFileConflictDialog
     GtkWidget *skip_button;
     GtkWidget *rename_button;
     GtkWidget *replace_button;
-    GtkWidget *dest_image;
-    GtkWidget *src_image;
+    GtkWidget *dest_icon;
+    GtkWidget *src_icon;
 };
 
 G_DEFINE_TYPE (NautilusFileConflictDialog, nautilus_file_conflict_dialog, GTK_TYPE_DIALOG);
@@ -72,8 +72,8 @@ nautilus_file_conflict_dialog_set_images (NautilusFileConflictDialog *fcd,
                                           GdkPaintable               *destination_paintable,
                                           GdkPaintable               *source_paintable)
 {
-    gtk_image_set_from_paintable (GTK_IMAGE (fcd->dest_image), destination_paintable);
-    gtk_image_set_from_paintable (GTK_IMAGE (fcd->src_image), source_paintable);
+    gtk_picture_set_paintable (GTK_PICTURE (fcd->dest_icon), destination_paintable);
+    gtk_picture_set_paintable (GTK_PICTURE (fcd->src_icon), source_paintable);
 }
 
 void
@@ -250,8 +250,8 @@ nautilus_file_conflict_dialog_class_init (NautilusFileConflictDialogClass *klass
     gtk_widget_class_bind_template_child (widget_class, NautilusFileConflictDialog, rename_button);
     gtk_widget_class_bind_template_child (widget_class, NautilusFileConflictDialog, replace_button);
     gtk_widget_class_bind_template_child (widget_class, NautilusFileConflictDialog, skip_button);
-    gtk_widget_class_bind_template_child (widget_class, NautilusFileConflictDialog, dest_image);
-    gtk_widget_class_bind_template_child (widget_class, NautilusFileConflictDialog, src_image);
+    gtk_widget_class_bind_template_child (widget_class, NautilusFileConflictDialog, dest_icon);
+    gtk_widget_class_bind_template_child (widget_class, NautilusFileConflictDialog, src_icon);
     gtk_widget_class_bind_template_callback (widget_class, entry_text_changed_cb);
     gtk_widget_class_bind_template_callback (widget_class, on_expanded_notify);
     gtk_widget_class_bind_template_callback (widget_class, checkbox_toggled_cb);
diff --git a/src/resources/ui/nautilus-file-conflict-dialog.ui 
b/src/resources/ui/nautilus-file-conflict-dialog.ui
index cfbafb481..8993fb659 100644
--- a/src/resources/ui/nautilus-file-conflict-dialog.ui
+++ b/src/resources/ui/nautilus-file-conflict-dialog.ui
@@ -45,7 +45,7 @@
                   <object class="GtkBox">
                     <property name="spacing">12</property>
                     <child>
-                      <object class="GtkImage" id="dest_image"/>
+                      <object class="GtkPicture" id="dest_icon"/>
                     </child>
                     <child>
                       <object class="GtkLabel" id="dest_label"/>
@@ -56,7 +56,7 @@
                   <object class="GtkBox">
                     <property name="spacing">12</property>
                     <child>
-                      <object class="GtkImage" id="src_image"/>
+                      <object class="GtkPicture" id="src_icon"/>
                     </child>
                     <child>
                       <object class="GtkLabel" id="src_label"/>


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