diff options
author | Owen Taylor <otaylor@redhat.com> | 2002-11-02 03:54:18 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2002-11-02 03:54:18 +0000 |
commit | 39a5a723f0381cca485fd366499a07e31b57c89f (patch) | |
tree | edea02343411f49926da4d1aa857ef27e5d671cf /gtk/gtkfilesel.c | |
parent | 00943af834ae457e5989daf7836cda0feb007544 (diff) | |
download | gtk+-39a5a723f0381cca485fd366499a07e31b57c89f.tar.gz |
Add a mnemonic to the "selection" label. (More of #74267)
Fri Nov 1 21:03:59 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: Add a mnemonic to the "selection"
label. (More of #74267)
* configure.in: Version 2.1.2
* NEWS: Updates.
Diffstat (limited to 'gtk/gtkfilesel.c')
-rw-r--r-- | gtk/gtkfilesel.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index 501c737450..72b5cccfb8 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -800,6 +800,9 @@ gtk_file_selection_init (GtkFileSelection *filesel) gtk_box_pack_start (GTK_BOX (entry_vbox), filesel->selection_entry, TRUE, TRUE, 0); gtk_widget_show (filesel->selection_entry); + gtk_label_set_mnemonic_widget (GTK_LABEL (filesel->selection_text), + filesel->selection_entry); + if (!cmpl_state_okay (filesel->cmpl_state)) { gchar err_buf[256]; @@ -2035,6 +2038,22 @@ win32_gtk_add_drives_to_dir_list (GtkListStore *model) } #endif +static gchar * +escape_underscores (const gchar *str) +{ + GString *result = g_string_new (NULL); + while (*str) + { + if (*str == '_') + g_string_append_c (result, '_'); + + g_string_append_c (result, *str); + str++; + } + + return g_string_free (result, FALSE); +} + static void gtk_file_selection_populate (GtkFileSelection *fs, gchar *rel_path, @@ -2165,11 +2184,11 @@ gtk_file_selection_populate (GtkFileSelection *fs, if (fs->selection_entry) { - sel_text = g_strconcat (_("Selection: "), - cmpl_reference_position (cmpl_state), - NULL); + char *escaped = escape_underscores (cmpl_reference_position (cmpl_state)); + sel_text = g_strconcat (_("_Selection: "), escaped, NULL); + g_free (escaped); - gtk_label_set_text (GTK_LABEL (fs->selection_text), sel_text); + gtk_label_set_text_with_mnemonic (GTK_LABEL (fs->selection_text), sel_text); g_free (sel_text); } |