summaryrefslogtreecommitdiff
path: root/gtk/gtkimmulticontext.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2008-09-30 00:58:39 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2008-09-30 00:58:39 +0000
commit1c8da0ca75c300c8b22abb45f163aec155ede629 (patch)
tree88058a1f40b6ec160ce3a8fd272bb4dd61392e3b /gtk/gtkimmulticontext.c
parent82e001ea415f400a9d8950b1efdabcea19d0c639 (diff)
downloadgtk+-1c8da0ca75c300c8b22abb45f163aec155ede629.tar.gz
Bug 553086 – hard to see current immodule
2008-09-29 Matthias Clasen <mclasen@redhat.com> 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
Diffstat (limited to 'gtk/gtkimmulticontext.c')
-rw-r--r--gtk/gtkimmulticontext.c23
1 files changed, 20 insertions, 3 deletions
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"),