From 1c8da0ca75c300c8b22abb45f163aec155ede629 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 30 Sep 2008 00:58:39 +0000 Subject: =?UTF-8?q?Bug=20553086=20=E2=80=93=20hard=20to=20see=20current=20?= =?UTF-8?q?immodule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-09-29 Matthias Clasen Bug 553086 – hard to see current immodule * gtk/gtkimmulticontext.c (gtk_im_multicontext_append_menuitems): Display the actually selected context in the system menuitem. Complaint by Akira Tagoh. svn path=/trunk/; revision=21548 --- gtk/gtkimmulticontext.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'gtk/gtkimmulticontext.c') diff --git a/gtk/gtkimmulticontext.c b/gtk/gtkimmulticontext.c index 70820a942a..8ce3aa988d 100644 --- a/gtk/gtkimmulticontext.c +++ b/gtk/gtkimmulticontext.c @@ -538,9 +538,11 @@ gtk_im_multicontext_append_menuitems (GtkIMMulticontext *context, const GtkIMContextInfo **contexts; guint n_contexts, i; GSList *group = NULL; - GtkWidget *menuitem; + GtkWidget *menuitem, *system_menuitem; + const char *system_context_id; - menuitem = gtk_radio_menu_item_new_with_label (group, Q_("input method menu|System")); + system_context_id = _gtk_im_module_get_default_context_id (context->priv->client_window); + system_menuitem = menuitem = gtk_radio_menu_item_new_with_label (group, Q_("input method menu|System")); if (!user_context_id) gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), TRUE); group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem)); @@ -550,6 +552,10 @@ gtk_im_multicontext_append_menuitems (GtkIMMulticontext *context, gtk_widget_show (menuitem); gtk_menu_shell_append (menushell, menuitem); + menuitem = gtk_separator_menu_item_new (); + gtk_widget_show (menuitem); + gtk_menu_shell_append (menushell, menuitem); + _gtk_im_module_list (&contexts, &n_contexts); for (i = 0; i < n_contexts; i++) @@ -613,7 +619,18 @@ gtk_im_multicontext_append_menuitems (GtkIMMulticontext *context, if ((user_context_id && strcmp (contexts[i]->context_id, user_context_id) == 0)) gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), TRUE); - + + if (strcmp (contexts[i]->context_id, system_context_id) == 0) + { + GtkWidget *label; + char *text; + + label = gtk_bin_get_child (GTK_BIN (system_menuitem)); + text = g_strdup_printf (Q_("input method menu|System (%s)"), translated_name); + gtk_label_set_text (GTK_LABEL (label), text); + g_free (text); + } + group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem)); g_object_set_data (G_OBJECT (menuitem), I_("gtk-context-id"), -- cgit v1.2.1