[gtk+] Menu items: force loading 16x16 icons
- From: Lars Uebernickel <larsu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Menu items: force loading 16x16 icons
- Date: Wed, 17 Dec 2014 16:52:36 +0000 (UTC)
commit b44df22895c794733e15d19a977bc9c2d5a2bd78
Author: Lars Uebernickel <lars uebernickel canonical com>
Date: Thu Dec 11 17:49:02 2014 +0100
Menu items: force loading 16x16 icons
GtkIconTheme doesn't scale icons beyond the size specified in the theme
anymore. This can result in arbitrarily large menu items when a theme
only provides large icons.
Force icons to always be 16x16 to ensure that menu items always have the
same height.
https://bugzilla.gnome.org/show_bug.cgi?id=741259
gtk/deprecated/gtkimagemenuitem.c | 1 +
gtk/gtkmodelmenuitem.c | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gtk/deprecated/gtkimagemenuitem.c b/gtk/deprecated/gtkimagemenuitem.c
index e308d51..1b46ead 100644
--- a/gtk/deprecated/gtkimagemenuitem.c
+++ b/gtk/deprecated/gtkimagemenuitem.c
@@ -1126,6 +1126,7 @@ gtk_image_menu_item_set_image (GtkImageMenuItem *image_menu_item,
"visible", show_image (image_menu_item),
"no-show-all", TRUE,
NULL);
+ gtk_image_set_pixel_size (GTK_IMAGE (image), 16);
g_object_notify (G_OBJECT (image_menu_item), "image");
}
diff --git a/gtk/gtkmodelmenuitem.c b/gtk/gtkmodelmenuitem.c
index dff3503..8591a7e 100644
--- a/gtk/gtkmodelmenuitem.c
+++ b/gtk/gtkmodelmenuitem.c
@@ -199,6 +199,7 @@ gtk_model_menu_item_set_icon (GtkModelMenuItem *item,
GtkWidget *image;
image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
+ gtk_image_set_pixel_size (GTK_IMAGE (image), 16);
gtk_box_pack_start (GTK_BOX (child), image, FALSE, FALSE, 0);
gtk_widget_show (image);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]