Commit 8a763ca4 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Fix handling of stock items without icons in action-based ui. (#342458,

2006-06-20  Matthias Clasen  <mclasen@redhat.com>

	Fix handling of stock items without icons in action-based
	ui.  (#342458, Callum McKenzie)

	* gtk/gtkactiongroup.c (gtk_action_group_add_actions_full): Set
	the stock id even if there is no icon for it.

	* gtk/gtkaction.c (connect_proxy):
	* gtk/gtktoolbutton.c (gtk_tool_button_construct_contents): Only
	construct a stock icon if the stock item has an icon.
parent 0bce4d27
2006-06-20 Matthias Clasen <mclasen@redhat.com>
Fix handling of stock items without icons in action-based
ui. (#342458, Callum McKenzie)
* gtk/gtkactiongroup.c (gtk_action_group_add_actions_full): Set
the stock id even if there is no icon for it.
* gtk/gtkaction.c (connect_proxy):
* gtk/gtktoolbutton.c (gtk_tool_button_construct_contents): Only
construct a stock icon if the stock item has an icon.
2006-06-20 Matthias Clasen <mclasen@redhat.com> 2006-06-20 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_set_column_drag_info): Better * gtk/gtktreeview.c (gtk_tree_view_set_column_drag_info): Better
......
2006-06-20 Matthias Clasen <mclasen@redhat.com>
Fix handling of stock items without icons in action-based
ui. (#342458, Callum McKenzie)
* gtk/gtkactiongroup.c (gtk_action_group_add_actions_full): Set
the stock id even if there is no icon for it.
* gtk/gtkaction.c (connect_proxy):
* gtk/gtktoolbutton.c (gtk_tool_button_construct_contents): Only
construct a stock icon if the stock item has an icon.
2006-06-20 Matthias Clasen <mclasen@redhat.com> 2006-06-20 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_set_column_drag_info): Better * gtk/gtktreeview.c (gtk_tree_view_set_column_drag_info): Better
......
...@@ -712,7 +712,9 @@ connect_proxy (GtkAction *action, ...@@ -712,7 +712,9 @@ connect_proxy (GtkAction *action,
image); image);
gtk_widget_show (image); gtk_widget_show (image);
} }
if (action->private_data->stock_id)
if (action->private_data->stock_id &&
gtk_icon_factory_lookup_default (action->private_data->stock_id))
gtk_image_set_from_stock (GTK_IMAGE (image), gtk_image_set_from_stock (GTK_IMAGE (image),
action->private_data->stock_id, GTK_ICON_SIZE_MENU); action->private_data->stock_id, GTK_ICON_SIZE_MENU);
else if (action->private_data->icon_name) else if (action->private_data->icon_name)
......
...@@ -782,9 +782,9 @@ gtk_action_group_add_actions_full (GtkActionGroup *action_group, ...@@ -782,9 +782,9 @@ gtk_action_group_add_actions_full (GtkActionGroup *action_group,
if (entries[i].stock_id) if (entries[i].stock_id)
{ {
if (gtk_icon_factory_lookup_default (entries[i].stock_id)) g_object_set (action, "stock-id", entries[i].stock_id, NULL);
g_object_set (action, "stock-id", entries[i].stock_id, NULL); if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (),
else entries[i].stock_id))
g_object_set (action, "icon-name", entries[i].stock_id, NULL); g_object_set (action, "icon-name", entries[i].stock_id, NULL);
} }
......
...@@ -405,7 +405,8 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item) ...@@ -405,7 +405,8 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
NULL); NULL);
} }
} }
else if (button->priv->stock_id) else if (button->priv->stock_id &&
gtk_icon_factory_lookup_default (button->priv->stock_id))
{ {
icon = gtk_image_new_from_stock (button->priv->stock_id, icon_size); icon = gtk_image_new_from_stock (button->priv->stock_id, icon_size);
gtk_widget_show (icon); gtk_widget_show (icon);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment