[gtk/about-dialog-icon-size: 1/4] about dialog: Remove manual icon sizing




commit 394732e8a839564b5ff56a288ba235d48f41a509
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 | 35 ++---------------------------------
 1 file changed, 2 insertions(+), 33 deletions(-)
---
diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c
index 745b45ea9b..f3584aee41 100644
--- a/gtk/gtkaboutdialog.c
+++ b/gtk/gtkaboutdialog.c
@@ -1645,40 +1645,9 @@ gtk_about_dialog_set_logo_icon_name (GtkAboutDialog *about,
     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);
-    }
+    gtk_image_set_from_icon_name (GTK_IMAGE (about->logo_image), icon_name);
   else
-    {
-      gtk_image_clear (GTK_IMAGE (about->logo_image));
-    }
+    gtk_image_clear (GTK_IMAGE (about->logo_image));
 
   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]