Turn off input methods in invisible entries, since they are confusing.
2005-11-18 Matthias Clasen <mclasen@redhat.com> Turn off input methods in invisible entries, since they are confusing. (#317002, James Su) * gtk/gtkentry.c (gtk_entry_set_visibility): Toggle input methods if visibility changes. (popup_targets_received): Don't show the input method menu if the entry is invisible.
This commit is contained in:
committed by
Matthias Clasen
parent
b46e6f72c2
commit
12064bf08a
10
ChangeLog
10
ChangeLog
@@ -1,3 +1,13 @@
|
||||
2005-11-18 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Turn off input methods in invisible entries, since
|
||||
they are confusing. (#317002, James Su)
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_set_visibility): Toggle input
|
||||
methods if visibility changes.
|
||||
(popup_targets_received): Don't show the input method
|
||||
menu if the entry is invisible.
|
||||
|
||||
2005-11-17 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* perf/treeview.c: const correctness fixes
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
2005-11-18 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Turn off input methods in invisible entries, since
|
||||
they are confusing. (#317002, James Su)
|
||||
|
||||
* gtk/gtkentry.c (gtk_entry_set_visibility): Toggle input
|
||||
methods if visibility changes.
|
||||
(popup_targets_received): Don't show the input method
|
||||
menu if the entry is invisible.
|
||||
|
||||
2005-11-17 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* perf/treeview.c: const correctness fixes
|
||||
|
||||
@@ -3950,9 +3950,37 @@ gtk_entry_set_visibility (GtkEntry *entry,
|
||||
{
|
||||
g_return_if_fail (GTK_IS_ENTRY (entry));
|
||||
|
||||
entry->visible = visible ? TRUE : FALSE;
|
||||
g_object_notify (G_OBJECT (entry), "visibility");
|
||||
gtk_entry_recompute (entry);
|
||||
visible = visible != FALSE;
|
||||
|
||||
if (entry->visible != visible)
|
||||
{
|
||||
if (GTK_WIDGET_HAS_FOCUS (entry) && !visible)
|
||||
gtk_im_context_focus_out (entry->im_context);
|
||||
|
||||
g_object_unref (entry->im_context);
|
||||
|
||||
if (visible)
|
||||
entry->im_context = gtk_im_multicontext_new ();
|
||||
else
|
||||
entry->im_context = gtk_im_context_simple_new ();
|
||||
|
||||
g_signal_connect (entry->im_context, "commit",
|
||||
G_CALLBACK (gtk_entry_commit_cb), entry);
|
||||
g_signal_connect (entry->im_context, "preedit_changed",
|
||||
G_CALLBACK (gtk_entry_preedit_changed_cb), entry);
|
||||
g_signal_connect (entry->im_context, "retrieve_surrounding",
|
||||
G_CALLBACK (gtk_entry_retrieve_surrounding_cb), entry);
|
||||
g_signal_connect (entry->im_context, "delete_surrounding",
|
||||
G_CALLBACK (gtk_entry_delete_surrounding_cb), entry);
|
||||
|
||||
if (GTK_WIDGET_HAS_FOCUS (entry) && visible)
|
||||
gtk_im_context_focus_in (entry->im_context);
|
||||
|
||||
entry->visible = visible;
|
||||
|
||||
g_object_notify (G_OBJECT (entry), "visibility");
|
||||
gtk_entry_recompute (entry);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4578,18 +4606,21 @@ popup_targets_received (GtkClipboard *clipboard,
|
||||
menuitem = gtk_separator_menu_item_new ();
|
||||
gtk_widget_show (menuitem);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (entry->popup_menu), menuitem);
|
||||
|
||||
if (entry->visible)
|
||||
{
|
||||
menuitem = gtk_menu_item_new_with_mnemonic (_("Input _Methods"));
|
||||
gtk_widget_set_sensitive (menuitem, entry->editable);
|
||||
gtk_widget_show (menuitem);
|
||||
submenu = gtk_menu_new ();
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
|
||||
|
||||
menuitem = gtk_menu_item_new_with_mnemonic (_("Input _Methods"));
|
||||
gtk_widget_set_sensitive (menuitem, entry->editable);
|
||||
gtk_widget_show (menuitem);
|
||||
submenu = gtk_menu_new ();
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
|
||||
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (entry->popup_menu), menuitem);
|
||||
|
||||
gtk_im_multicontext_append_menuitems (GTK_IM_MULTICONTEXT (entry->im_context),
|
||||
GTK_MENU_SHELL (submenu));
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (entry->popup_menu), menuitem);
|
||||
|
||||
gtk_im_multicontext_append_menuitems (GTK_IM_MULTICONTEXT (entry->im_context),
|
||||
GTK_MENU_SHELL (submenu));
|
||||
}
|
||||
|
||||
menuitem = gtk_menu_item_new_with_mnemonic (_("_Insert Unicode Control Character"));
|
||||
gtk_widget_show (menuitem);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user