summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-04-24 13:41:15 +0200
committerStefano Karapetsas <[email protected]>2014-04-24 13:41:15 +0200
commit5decde94c5e8c9dc3856c1497eab32f3671a39bc (patch)
treed64f5b39602852cd54562008c5376fc27a82b46d
parentf168e1e4595cc94c9304f312e668b992377a75f9 (diff)
downloadmate-desktop-5decde94c5e8c9dc3856c1497eab32f3671a39bc.tar.bz2
mate-desktop-5decde94c5e8c9dc3856c1497eab32f3671a39bc.tar.xz
Use bigger logo image in about dialog, if available in icon theme
Code taken from GTK3 about dialog
-rw-r--r--libmate-desktop/mate-aboutdialog.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libmate-desktop/mate-aboutdialog.c b/libmate-desktop/mate-aboutdialog.c
index 0ef99c5..f2a8a24 100644
--- a/libmate-desktop/mate-aboutdialog.c
+++ b/libmate-desktop/mate-aboutdialog.c
@@ -1671,8 +1671,36 @@ mate_about_dialog_set_logo_icon_name (MateAboutDialog *about,
if (gtk_image_get_storage_type (GTK_IMAGE (priv->logo_image)) == GTK_IMAGE_PIXBUF)
g_object_notify (G_OBJECT (about), "logo");
+ gint *sizes = gtk_icon_theme_get_icon_sizes (gtk_icon_theme_get_default (),
+ icon_name);
+ gint 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 (priv->logo_image), icon_name,
GTK_ICON_SIZE_DIALOG);
+ gtk_image_set_pixel_size (GTK_IMAGE (priv->logo_image), best_size);
+
g_object_notify (G_OBJECT (about), "logo-icon-name");
g_object_thaw_notify (G_OBJECT (about));