Properly create a menu proxy from a GIcon. Patch by Christian Persch
* gtk/gtktoolbutton.c: Properly create a menu proxy from a GIcon.
Patch by Christian Persch
* tests/testtoolbar.c: Add an example with a GIcon
svn path=/trunk/; revision=22084
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -1,3 +1,13 @@
|
||||
2009-01-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Bug 567024 – gtktoolbutton doesn't create right proxy menu item
|
||||
image with GIcon
|
||||
|
||||
* gtk/gtktoolbutton.c: Properly create a menu proxy from a GIcon.
|
||||
Patch by Christian Persch
|
||||
|
||||
* tests/testtoolbar.c: Add an example with a GIcon
|
||||
|
||||
2009-01-09 Christian Dywan <christian@imendio.com>
|
||||
|
||||
Fail in gdk_window_new if _gdk_window_new failed
|
||||
|
||||
@@ -579,6 +579,12 @@ clone_image_menu_size (GtkImage *image, GtkSettings *settings)
|
||||
gtk_image_get_icon_set (image, &icon_set, NULL);
|
||||
return gtk_image_new_from_icon_set (icon_set, GTK_ICON_SIZE_MENU);
|
||||
}
|
||||
else if (storage_type == GTK_IMAGE_GICON)
|
||||
{
|
||||
GIcon *icon;
|
||||
gtk_image_get_gicon (image, &icon, NULL);
|
||||
return gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
|
||||
}
|
||||
else if (storage_type == GTK_IMAGE_PIXBUF)
|
||||
{
|
||||
gint width, height;
|
||||
|
||||
@@ -511,6 +511,7 @@ main (gint argc, gchar **argv)
|
||||
GtkWidget *menuitem;
|
||||
GtkWidget *button;
|
||||
GtkWidget *label;
|
||||
GIcon *gicon;
|
||||
GSList *group;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
@@ -706,7 +707,14 @@ main (gint argc, gchar **argv)
|
||||
add_item_to_list (store, item, "Apple");
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
|
||||
gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (item), TRUE);
|
||||
|
||||
|
||||
gicon = g_content_type_get_icon ("video/ogg");
|
||||
image = gtk_image_new_from_gicon (gicon, GTK_ICON_SIZE_LARGE_TOOLBAR);
|
||||
g_object_unref (gicon);
|
||||
item = gtk_tool_button_new (image, "Video");
|
||||
add_item_to_list (store, item, "Video");
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
|
||||
gtk_table_attach (GTK_TABLE (table), hbox,
|
||||
|
||||
Reference in New Issue
Block a user