gtk+ r22210 - in trunk: . gtk
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r22210 - in trunk: . gtk
- Date: Sat, 24 Jan 2009 22:00:07 +0000 (UTC)
Author: matthiasc
Date: Sat Jan 24 22:00:07 2009
New Revision: 22210
URL: http://svn.gnome.org/viewvc/gtk+?rev=22210&view=rev
Log:
Fallback from stock ids to icon names like the old GtkAction code did
Modified:
trunk/ChangeLog
trunk/gtk/gtktoolbutton.c
Modified: trunk/gtk/gtktoolbutton.c
==============================================================================
--- trunk/gtk/gtktoolbutton.c (original)
+++ trunk/gtk/gtktoolbutton.c Sat Jan 24 22:00:07 2009
@@ -772,6 +772,7 @@
gtk_tool_button_set_label (button, NULL);
gtk_tool_button_set_icon_name (button, NULL);
}
+ gtk_tool_button_set_icon_widget (button, NULL);
gtk_tool_button_set_stock_id (button, gtk_action_get_stock_id (action));
}
else if (strcmp (property_name, "gicon") == 0)
@@ -812,6 +813,7 @@
{
GtkToolButton *button;
GIcon *icon;
+ const gchar *stock_id;
parent_activatable_iface->reset (activatable, action);
@@ -822,14 +824,15 @@
return;
button = GTK_TOOL_BUTTON (activatable);
-
- gtk_tool_button_set_label (button, NULL);
- gtk_tool_button_set_stock_id (button, NULL);
- gtk_tool_button_set_icon_name (button, NULL);
+ stock_id = gtk_action_get_stock_id (action);
+
+ gtk_tool_button_set_label (button, gtk_action_get_short_label (action));
gtk_tool_button_set_use_underline (button, TRUE);
-
- if (gtk_action_get_stock_id (action))
- gtk_tool_button_set_stock_id (button, gtk_action_get_stock_id (action));
+ gtk_tool_button_set_stock_id (button, stock_id);
+ gtk_tool_button_set_icon_name (button, gtk_action_get_icon_name (action));
+
+ if (stock_id && gtk_icon_factory_lookup_default (stock_id))
+ gtk_tool_button_set_icon_widget (button, NULL);
else if ((icon = gtk_action_get_gicon (action)) != NULL)
{
GtkIconSize icon_size = gtk_tool_item_get_icon_size (GTK_TOOL_ITEM (button));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]