aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk
diff options
context:
space:
mode:
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r--libdbusmenu-gtk/genericmenuitem.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libdbusmenu-gtk/genericmenuitem.c b/libdbusmenu-gtk/genericmenuitem.c
index 81d67fe..75bdbbd 100644
--- a/libdbusmenu-gtk/genericmenuitem.c
+++ b/libdbusmenu-gtk/genericmenuitem.c
@@ -242,7 +242,7 @@ has_mnemonic (const gchar * string, gboolean previous_underscore)
}
/* Sanitize the label by removing "__" meaning "_" */
-gchar *
+static gchar *
sanitize_label (const gchar * in_label)
{
static GRegex * underscore_regex = NULL;
@@ -335,10 +335,10 @@ set_label (GtkMenuItem * menu_item, const gchar * in_label)
labelw = GTK_LABEL(gtk_accel_label_new(local_label));
gtk_label_set_use_markup(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));
if (has_mnemonic(in_label, FALSE)) {
gtk_label_set_use_underline(GTK_LABEL(labelw), TRUE);
- gtk_accel_label_set_accel_widget(GTK_ACCEL_LABEL(labelw), GTK_WIDGET(menu_item));
gtk_label_set_markup_with_mnemonic(labelw, local_label);
} else {
gchar * sanitized = sanitize_label(local_label);
@@ -365,7 +365,6 @@ set_label (GtkMenuItem * menu_item, const gchar * in_label)
} else {
if (has_mnemonic(in_label, FALSE)) {
gtk_label_set_use_underline(GTK_LABEL(labelw), TRUE);
- gtk_accel_label_set_accel_widget(GTK_ACCEL_LABEL(labelw), GTK_WIDGET(menu_item));
gtk_label_set_markup_with_mnemonic(labelw, local_label);
} else {
gchar * sanitized = sanitize_label(local_label);