diff options
author | Benjamin Otte <otte@redhat.com> | 2018-08-13 05:19:05 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-03-25 23:14:27 -0400 |
commit | 90c7f4608a3840ec8aec9285ac3de8a63200907a (patch) | |
tree | 67c9b337cd511643bdd6d16b4b2856c41cd5805c /gtk/gtkaccelgroup.c | |
parent | 66102dacf13813473a82c02cb7b67d1971f1397e (diff) | |
download | gtk+-90c7f4608a3840ec8aec9285ac3de8a63200907a.tar.gz |
accelgroup: Add gtk_accel_group_print_label()
Diffstat (limited to 'gtk/gtkaccelgroup.c')
-rw-r--r-- | gtk/gtkaccelgroup.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gtk/gtkaccelgroup.c b/gtk/gtkaccelgroup.c index 0e95d26926..0dea8cd6f7 100644 --- a/gtk/gtkaccelgroup.c +++ b/gtk/gtkaccelgroup.c @@ -1812,11 +1812,22 @@ gtk_accelerator_get_label (guint accelerator_key, GdkModifierType accelerator_mods) { GString *gstring; + + gstring = g_string_new (NULL); + + gtk_accelerator_print_label (gstring, accelerator_key, accelerator_mods); + + return g_string_free (gstring, FALSE); +} + +void +gtk_accelerator_print_label (GString *gstring, + guint accelerator_key, + GdkModifierType accelerator_mods) +{ gboolean seen_mod = FALSE; gunichar ch; - gstring = g_string_sized_new (10); /* ~len('backspace') */ - if (accelerator_mods & GDK_SHIFT_MASK) { #ifndef GDK_WINDOWING_QUARTZ @@ -1996,8 +2007,6 @@ gtk_accelerator_get_label (guint accelerator_key, } } } - - return g_string_free (gstring, FALSE); } /** |