[gtk/about-dialog-icon-size: 3/7] about dialog: Remove manual icon sizing




commit 96baf9769a0b3ca1c364708e58785c39499f6068
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jan 11 14:38:18 2021 -0500

    about dialog: Remove manual icon sizing
    
    We have icon theme code to do that for us.

 gtk/gtkaboutdialog.c | 36 +-----------------------------------
 1 file changed, 1 insertion(+), 35 deletions(-)
---
diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c
index 745b45ea9b..bff8e76432 100644
--- a/gtk/gtkaboutdialog.c
+++ b/gtk/gtkaboutdialog.c
@@ -1644,41 +1644,7 @@ gtk_about_dialog_set_logo_icon_name (GtkAboutDialog *about,
   if (gtk_image_get_storage_type (GTK_IMAGE (about->logo_image)) == GTK_IMAGE_PAINTABLE)
     g_object_notify_by_pspec (G_OBJECT (about), props[PROP_LOGO]);
 
-  if (icon_name)
-    {
-      GtkIconTheme *icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET 
(about)));
-      int *sizes = gtk_icon_theme_get_icon_sizes (icon_theme, icon_name);
-      int i, best_size = 0;
-
-      for (i = 0; sizes[i]; i++)
-        {
-          if (sizes[i] >= 128 || sizes[i] == -1)
-            {
-              best_size = 128;
-              break;
-            }
-          else if (sizes[i] >= 96)
-            {
-              best_size = MAX (96, best_size);
-            }
-          else if (sizes[i] >= 64)
-            {
-              best_size = MAX (64, best_size);
-            }
-          else
-            {
-              best_size = MAX (48, best_size);
-            }
-        }
-      g_free (sizes);
-
-      gtk_image_set_from_icon_name (GTK_IMAGE (about->logo_image), icon_name);
-      gtk_image_set_pixel_size (GTK_IMAGE (about->logo_image), best_size);
-    }
-  else
-    {
-      gtk_image_clear (GTK_IMAGE (about->logo_image));
-    }
+  gtk_image_set_from_icon_name (GTK_IMAGE (about->logo_image), icon_name);
 
   g_object_notify_by_pspec (G_OBJECT (about), props[PROP_LOGO_ICON_NAME]);
 


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