Handle keypresses better when there is no completion. (#458298, Christian

2007-07-19  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkentry.c (gtk_entry_completion_key_press): Handle
        keypresses better when there is no completion.  (#458298,
        Christian Persch, patch by Xan Lopez)

        * gtk/gtkentrycompletion.c
        (gtk_entry_completion_insert_completion_text): Small cleanup.



svn path=/trunk/; revision=18505
This commit is contained in:
Matthias Clasen 2007-07-19 15:44:23 +00:00 committed by Matthias Clasen
parent e1926de86a
commit 6a45d5b825
3 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,12 @@
2007-07-19 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.c (gtk_entry_completion_key_press): Handle
keypresses better when there is no completion. (#458298,
Christian Persch, patch by Xan Lopez)
* gtk/gtkentrycompletion.c
(gtk_entry_completion_insert_completion_text): Small cleanup.
2007-07-19 Matthias Clasen <mclasen@redhat.com>
* gtk/gtksettings.c (apply_queued_setting): Merge color

View File

@ -5893,9 +5893,17 @@ gtk_entry_completion_key_press (GtkWidget *widget,
event->keyval == GDK_Right ||
event->keyval == GDK_KP_Right)
{
GtkTreeSelection *sel;
GtkTreeIter iter;
GtkTreeModel *model = NULL;
_gtk_entry_reset_im_context (GTK_ENTRY (widget));
_gtk_entry_completion_popdown (completion);
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (completion->priv->tree_view));
if (!gtk_tree_selection_get_selected (sel, &model, &iter))
return FALSE;
if (completion->priv->inline_selection)
{
/* Escape rejects the tentative completion */

View File

@ -1690,7 +1690,8 @@ gtk_entry_completion_insert_completion_text (GtkEntryCompletion *completion,
if (completion->priv->completion_prefix == NULL)
completion->priv->completion_prefix = g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->entry)));
gtk_entry_set_text (GTK_ENTRY (priv->entry), text);
gtk_entry_set_text (GTK_ENTRY (priv->entry), text);
len = strlen (priv->completion_prefix);
gtk_editable_select_region (GTK_EDITABLE (priv->entry), len, -1);