diff options
author | Ted Gould <ted@gould.cx> | 2010-06-21 15:07:26 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-06-21 15:07:26 -0500 |
commit | b38e886a4ae63fb59b98bbf1673b8c76c0f1ba4e (patch) | |
tree | 261da2b1d53a2d5d0be0993292bf9e742555e3fe /libdbusmenu-gtk/genericmenuitem.c | |
parent | da753d7953b6abe0ed14009eddc7e50a0617ca8f (diff) | |
parent | 424ab1c0d64300c065c3f19e1b5fae222f8828e9 (diff) | |
download | libdbusmenu-b38e886a4ae63fb59b98bbf1673b8c76c0f1ba4e.tar.gz libdbusmenu-b38e886a4ae63fb59b98bbf1673b8c76c0f1ba4e.tar.bz2 libdbusmenu-b38e886a4ae63fb59b98bbf1673b8c76c0f1ba4e.zip |
* Upstream Merge
* Adding support for menu shortcuts
* Fixing distcheck of documentation builds
Diffstat (limited to 'libdbusmenu-gtk/genericmenuitem.c')
-rw-r--r-- | libdbusmenu-gtk/genericmenuitem.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libdbusmenu-gtk/genericmenuitem.c b/libdbusmenu-gtk/genericmenuitem.c index 8f40d93..30b072f 100644 --- a/libdbusmenu-gtk/genericmenuitem.c +++ b/libdbusmenu-gtk/genericmenuitem.c @@ -158,6 +158,8 @@ get_hpadding (GtkWidget * widget) static void set_label (GtkMenuItem * menu_item, const gchar * label) { + if (label == NULL) return; + GtkWidget * child = gtk_bin_get_child(GTK_BIN(menu_item)); GtkLabel * labelw = NULL; gboolean suppress_update = FALSE; @@ -191,9 +193,10 @@ set_label (GtkMenuItem * menu_item, const gchar * label) update the one that we already have. */ if (labelw == NULL) { /* Build it */ - labelw = GTK_LABEL(gtk_label_new(label)); + labelw = GTK_LABEL(gtk_accel_label_new(label)); gtk_label_set_use_underline(GTK_LABEL(labelw), TRUE); gtk_misc_set_alignment(GTK_MISC(labelw), 0.0, 0.5); + gtk_accel_label_set_accel_widget(GTK_ACCEL_LABEL(labelw), GTK_WIDGET(menu_item)); gtk_widget_show(GTK_WIDGET(labelw)); /* Check to see if it needs to be in the bin for this |