Convert underscores in keyval names to spaces. (#131480)

Tue Feb 24 17:51:49 2004  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkaccellabel.c (gtk_accel_label_refetch): Convert
        underscores in keyval names to spaces. (#131480)
This commit is contained in:
Owen Taylor 2004-02-24 22:59:51 +00:00 committed by Owen Taylor
parent 89a877800a
commit b435c31d75
6 changed files with 39 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Tue Feb 24 17:51:49 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c (gtk_accel_label_refetch): Convert
underscores in keyval names to spaces. (#131480)
Tue Feb 24 17:35:59 2004 Owen Taylor <otaylor@redhat.com>
* m4macros/gtk-2.0.m4: Add some quotes around ***. (#130073,

View File

@ -1,3 +1,8 @@
Tue Feb 24 17:51:49 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c (gtk_accel_label_refetch): Convert
underscores in keyval names to spaces. (#131480)
Tue Feb 24 17:35:59 2004 Owen Taylor <otaylor@redhat.com>
* m4macros/gtk-2.0.m4: Add some quotes around ***. (#130073,

View File

@ -1,3 +1,8 @@
Tue Feb 24 17:51:49 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c (gtk_accel_label_refetch): Convert
underscores in keyval names to spaces. (#131480)
Tue Feb 24 17:35:59 2004 Owen Taylor <otaylor@redhat.com>
* m4macros/gtk-2.0.m4: Add some quotes around ***. (#130073,

View File

@ -1,3 +1,8 @@
Tue Feb 24 17:51:49 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c (gtk_accel_label_refetch): Convert
underscores in keyval names to spaces. (#131480)
Tue Feb 24 17:35:59 2004 Owen Taylor <otaylor@redhat.com>
* m4macros/gtk-2.0.m4: Add some quotes around ***. (#130073,

View File

@ -1,3 +1,8 @@
Tue Feb 24 17:51:49 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c (gtk_accel_label_refetch): Convert
underscores in keyval names to spaces. (#131480)
Tue Feb 24 17:35:59 2004 Owen Taylor <otaylor@redhat.com>
* m4macros/gtk-2.0.m4: Add some quotes around ***. (#130073,

View File

@ -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);
}