diff options
Diffstat (limited to 'gtk/gtkaccellabel.c')
-rw-r--r-- | gtk/gtkaccellabel.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c index 5af947a45d..86b993a669 100644 --- a/gtk/gtkaccellabel.c +++ b/gtk/gtkaccellabel.c @@ -503,6 +503,19 @@ gtk_accel_label_get_string (GtkAccelLabel *accel_label) return accel_label->accel_string; } +/* Underscores in key names are better displayed as spaces + * E.g., Page_Up should be "Page Up" + */ +static void +substitute_underscores (char *str) +{ + char *p; + + for (p = str; *p; p++) + if (*p == '_') + *p = ' '; +} + gboolean gtk_accel_label_refetch (GtkAccelLabel *accel_label) { @@ -577,6 +590,7 @@ gtk_accel_label_refetch (GtkAccelLabel *accel_label) tmp = gtk_accelerator_name (key->accel_key, 0); if (tmp[0] != 0 && tmp[1] == 0) tmp[0] = g_ascii_toupper (tmp[0]); + substitute_underscores (tmp); g_string_append (gstring, tmp); g_free (tmp); } |