[Xfce4-commits] <libxfce4ui:master> Show the accelerator label in the shortcut dialog.

Jérôme Guelfucci noreply at xfce.org
Sun Dec 30 15:42:37 CET 2012


Updating branch refs/heads/master
         to f29fa617c47ac595d4c13095eb210fdf0b54aad2 (commit)
       from 173f728069b313c4091120a81565bd4ef13fad51 (commit)

commit f29fa617c47ac595d4c13095eb210fdf0b54aad2
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Thu Dec 20 23:38:22 2012 +0100

    Show the accelerator label in the shortcut dialog.

 libxfce4kbd-private/xfce-shortcut-dialog.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/libxfce4kbd-private/xfce-shortcut-dialog.c b/libxfce4kbd-private/xfce-shortcut-dialog.c
index 38e53ea..fc5b6fa 100644
--- a/libxfce4kbd-private/xfce-shortcut-dialog.c
+++ b/libxfce4kbd-private/xfce-shortcut-dialog.c
@@ -357,7 +357,8 @@ xfce_shortcut_dialog_key_pressed (XfceShortcutDialog *dialog,
   GdkModifierType  consumed, modifiers;
   guint            keyval, mod_mask;
   gchar           *text;
-  gchar           *shortcut;
+  gchar           *escaped_label;
+  gchar           *label;
 
   g_free (dialog->shortcut);
 
@@ -392,13 +393,16 @@ xfce_shortcut_dialog_key_pressed (XfceShortcutDialog *dialog,
   /* Get and store the pressed shortcut */
   dialog->shortcut = gtk_accelerator_name (keyval, modifiers);
 
-  shortcut = g_markup_escape_text (dialog->shortcut, -1);
-  text = g_strdup_printf ("<span size='large'><b>%s</b></span>", shortcut);
+  label = gtk_accelerator_get_label (keyval, modifiers);
+  escaped_label = g_markup_escape_text (label, -1);
+  text = g_strdup_printf ("<span size='large'><b>%s</b></span>",
+                          escaped_label);
 
   gtk_label_set_markup (GTK_LABEL (dialog->shortcut_label), text);
 
+  g_free (label);
+  g_free (escaped_label);
   g_free (text);
-  g_free (shortcut);
 
   return FALSE;
 }


More information about the Xfce4-commits mailing list