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
This commit is contained in:
parent
9032e08843
commit
b44df22895
@ -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");
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user