diff options
author | Gaƫl Bonithon <gael@xfce.org> | 2022-03-13 22:11:08 +0000 |
---|---|---|
committer | Alexander Schwinn <alexxcons@xfce.org> | 2022-03-13 22:11:08 +0000 |
commit | 98c3e867d10ba378b0915a4349db7cdf6ab66414 (patch) | |
tree | ee5c45a48cabf34ec9c11a43fee0856ede8885af | |
parent | 12072b663a51cd804abdf61f0d8d09bfe72efc1e (diff) | |
download | libxfce4ui-98c3e867d10ba378b0915a4349db7cdf6ab66414.tar.gz |
XfceShortcutsEditor: Remove label formatting if necessary
This prevents mnemonics in the text of 'xfce_shortcut_dialog', which is used to record new shortcuts.
-rw-r--r-- | libxfce4kbd-private/xfce-shortcuts-editor.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libxfce4kbd-private/xfce-shortcuts-editor.c b/libxfce4kbd-private/xfce-shortcuts-editor.c index 045c053..65412f6 100644 --- a/libxfce4kbd-private/xfce-shortcuts-editor.c +++ b/libxfce4kbd-private/xfce-shortcuts-editor.c @@ -40,6 +40,7 @@ typedef struct { XfceShortcutsEditor *editor; XfceGtkActionEntry *entry; + const gchar *displayed_label; } ShortcutEditClickedData; typedef struct @@ -319,8 +320,9 @@ xfce_shortcuts_editor_create_contents (XfceShortcutsEditor *editor) reset_data = malloc (sizeof (ShortcutOtherClickedData)); label = gtk_label_new_with_mnemonic (entry.menu_item_label_text); + data->displayed_label = gtk_label_get_text (GTK_LABEL (label)); gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END); - gtk_widget_set_tooltip_text (label, gtk_label_get_text (GTK_LABEL (label))); /* this way mnemonics are removed */ + gtk_widget_set_tooltip_text (label, data->displayed_label); gtk_widget_set_hexpand (label, TRUE); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_margin_start (label, 10); @@ -467,7 +469,7 @@ xfce_shortcuts_editor_shortcut_clicked (GtkWidget *widget, guint accel_key; gchar *label; - dialog = xfce_shortcut_dialog_new ("", data->entry->menu_item_label_text, ""); + dialog = xfce_shortcut_dialog_new ("", data->displayed_label, ""); g_signal_connect (dialog, "validate-shortcut", G_CALLBACK (xfce_shortcuts_editor_validate_shortcut), data); |