aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-09-20 02:21:06 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-09-20 02:21:06 +0800
commit6b2295c93a40f6010d94399666a8e099aded8e85 (patch)
treec403d191ffbef6c12a7c97a0ee05838e7b23c8f3 /widgets
parent3e3c13b439668945241b32cf8c1fd3d6e625f9f5 (diff)
downloadgsoc2013-evolution-6b2295c93a40f6010d94399666a8e099aded8e85.tar.gz
gsoc2013-evolution-6b2295c93a40f6010d94399666a8e099aded8e85.tar.zst
gsoc2013-evolution-6b2295c93a40f6010d94399666a8e099aded8e85.zip
Fix some miscellaneous address book bugs.
Kill e-shell-constants.h. svn path=/branches/kill-bonobo/; revision=36392
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-menu-tool-button.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/widgets/misc/e-menu-tool-button.c b/widgets/misc/e-menu-tool-button.c
index f2ff6ded44..70e64d8124 100644
--- a/widgets/misc/e-menu-tool-button.c
+++ b/widgets/misc/e-menu-tool-button.c
@@ -58,12 +58,14 @@ menu_tool_button_get_first_menu_item (GtkMenuToolButton *menu_tool_button)
}
static void
-menu_tool_button_update_icon (GtkToolButton *tool_button)
+menu_tool_button_update_button (GtkToolButton *tool_button)
{
GtkMenuItem *menu_item;
GtkMenuToolButton *menu_tool_button;
GtkImageMenuItem *image_menu_item;
+ GtkAction *action;
GtkWidget *image;
+ gchar *tooltip = NULL;
menu_tool_button = GTK_MENU_TOOL_BUTTON (tool_button);
menu_item = menu_tool_button_get_first_menu_item (menu_tool_button);
@@ -78,6 +80,14 @@ menu_tool_button_update_icon (GtkToolButton *tool_button)
image = menu_tool_button_clone_image (image);
gtk_tool_button_set_icon_widget (tool_button, image);
gtk_widget_show (image);
+
+ /* If the menu item is a proxy for a GtkAction, extract
+ * the action's tooltip and use it as our own tooltip. */
+ action = gtk_widget_get_action (GTK_WIDGET (menu_item));
+ if (action != NULL)
+ g_object_get (action, "tooltip", &tooltip, NULL);
+ gtk_widget_set_tooltip_text (GTK_WIDGET (tool_button), tooltip);
+ g_free (tooltip);
}
static void
@@ -109,7 +119,7 @@ menu_tool_button_init (EMenuToolButton *button)
{
g_signal_connect (
button, "notify::menu",
- G_CALLBACK (menu_tool_button_update_icon), NULL);
+ G_CALLBACK (menu_tool_button_update_button), NULL);
}
GType