[Xfce4-commits] <libxfce4ui:jeromeg/keyboard-shortcuts> Show the accelerator label in the shortcut dialog.

Jérôme Guelfucci noreply at xfce.org
Thu Dec 20 23:40:01 CET 2012


Updating branch refs/heads/jeromeg/keyboard-shortcuts
         to f3ed87bd674c0e7464018082566fbb62a9226628 (commit)
       from e5637cc58ae7b44ba0e0ff2cdc797757d23d8f05 (commit)

commit f3ed87bd674c0e7464018082566fbb62a9226628
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