Commit 027d6900 authored by Kristian Rietveld's avatar Kristian Rietveld Committed by Kristian Rietveld

remove the reset of first_sel_changed, as after the first popup the

Mon Oct 13 21:01:43 2003  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtkentrycompletion.c (gtk_entry_completion_popup): remove
	the reset of first_sel_changed, as after the first popup the treeview
	will always have a row selected and will thus not focus_to_cursor.

	* gtk/gtkentry.c (keyval_is_cursor_move): new function to determine
	whether the keyval should move the completion selection cursor (used
	to avoid ending up with extreme cluttered code), also added
	all KP_ equivalents of the keys here,
	(gtk_entry_completion_key_press): Keynav tweaks based on comments
	from Dave Bordoley and Marco Pesenti Gritti; add the -1 state
	as possible current selection, implement Home/End keys, modified
	the down key to stop cycling. Maybe page up/down should be implemented
	at some later time.
parent 2baa63a1
Mon Oct 13 21:01:43 2003 Kristian Rietveld <kris@gtk.org>
* gtk/gtkentrycompletion.c (gtk_entry_completion_popup): remove
the reset of first_sel_changed, as after the first popup the treeview
will always have a row selected and will thus not focus_to_cursor.
* gtk/gtkentry.c (keyval_is_cursor_move): new function to determine
whether the keyval should move the completion selection cursor (used
to avoid ending up with extreme cluttered code), also added
all KP_ equivalents of the keys here,
(gtk_entry_completion_key_press): Keynav tweaks based on comments
from Dave Bordoley and Marco Pesenti Gritti; add the -1 state
as possible current selection, implement Home/End keys, modified
the down key to stop cycling. Maybe page up/down should be implemented
at some later time.
Mon Oct 13 20:58:07 2003 Matthias Clasen <maclas@gmx.de>
* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon): Make it work
......
Mon Oct 13 21:01:43 2003 Kristian Rietveld <kris@gtk.org>
* gtk/gtkentrycompletion.c (gtk_entry_completion_popup): remove
the reset of first_sel_changed, as after the first popup the treeview
will always have a row selected and will thus not focus_to_cursor.
* gtk/gtkentry.c (keyval_is_cursor_move): new function to determine
whether the keyval should move the completion selection cursor (used
to avoid ending up with extreme cluttered code), also added
all KP_ equivalents of the keys here,
(gtk_entry_completion_key_press): Keynav tweaks based on comments
from Dave Bordoley and Marco Pesenti Gritti; add the -1 state
as possible current selection, implement Home/End keys, modified
the down key to stop cycling. Maybe page up/down should be implemented
at some later time.
Mon Oct 13 20:58:07 2003 Matthias Clasen <maclas@gmx.de>
* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon): Make it work
......
Mon Oct 13 21:01:43 2003 Kristian Rietveld <kris@gtk.org>
* gtk/gtkentrycompletion.c (gtk_entry_completion_popup): remove
the reset of first_sel_changed, as after the first popup the treeview
will always have a row selected and will thus not focus_to_cursor.
* gtk/gtkentry.c (keyval_is_cursor_move): new function to determine
whether the keyval should move the completion selection cursor (used
to avoid ending up with extreme cluttered code), also added
all KP_ equivalents of the keys here,
(gtk_entry_completion_key_press): Keynav tweaks based on comments
from Dave Bordoley and Marco Pesenti Gritti; add the -1 state
as possible current selection, implement Home/End keys, modified
the down key to stop cycling. Maybe page up/down should be implemented
at some later time.
Mon Oct 13 20:58:07 2003 Matthias Clasen <maclas@gmx.de>
* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon): Make it work
......
Mon Oct 13 21:01:43 2003 Kristian Rietveld <kris@gtk.org>
* gtk/gtkentrycompletion.c (gtk_entry_completion_popup): remove
the reset of first_sel_changed, as after the first popup the treeview
will always have a row selected and will thus not focus_to_cursor.
* gtk/gtkentry.c (keyval_is_cursor_move): new function to determine
whether the keyval should move the completion selection cursor (used
to avoid ending up with extreme cluttered code), also added
all KP_ equivalents of the keys here,
(gtk_entry_completion_key_press): Keynav tweaks based on comments
from Dave Bordoley and Marco Pesenti Gritti; add the -1 state
as possible current selection, implement Home/End keys, modified
the down key to stop cycling. Maybe page up/down should be implemented
at some later time.
Mon Oct 13 20:58:07 2003 Matthias Clasen <maclas@gmx.de>
* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon): Make it work
......
Mon Oct 13 21:01:43 2003 Kristian Rietveld <kris@gtk.org>
* gtk/gtkentrycompletion.c (gtk_entry_completion_popup): remove
the reset of first_sel_changed, as after the first popup the treeview
will always have a row selected and will thus not focus_to_cursor.
* gtk/gtkentry.c (keyval_is_cursor_move): new function to determine
whether the keyval should move the completion selection cursor (used
to avoid ending up with extreme cluttered code), also added
all KP_ equivalents of the keys here,
(gtk_entry_completion_key_press): Keynav tweaks based on comments
from Dave Bordoley and Marco Pesenti Gritti; add the -1 state
as possible current selection, implement Home/End keys, modified
the down key to stop cycling. Maybe page up/down should be implemented
at some later time.
Mon Oct 13 20:58:07 2003 Matthias Clasen <maclas@gmx.de>
* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon): Make it work
......
......@@ -4511,6 +4511,24 @@ gtk_entry_completion_timeout (gpointer data)
return FALSE;
}
static inline gboolean
keyval_is_cursor_move (guint keyval)
{
if (keyval == GDK_Up || keyval == GDK_KP_Up)
return TRUE;
if (keyval == GDK_Down || keyval == GDK_KP_Down)
return TRUE;
if (keyval == GDK_Home || keyval == GDK_KP_Home)
return TRUE;
if (keyval == GDK_End || keyval == GDK_KP_End)
return TRUE;
return FALSE;
}
static gboolean
gtk_entry_completion_key_press (GtkWidget *widget,
GdkEventKey *event,
......@@ -4527,24 +4545,33 @@ gtk_entry_completion_key_press (GtkWidget *widget,
if (completion->priv->actions)
actions = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (completion->priv->actions), NULL);
if (event->keyval == GDK_Up || event->keyval == GDK_Down)
if (keyval_is_cursor_move (event->keyval))
{
GtkTreePath *path = NULL;
if (event->keyval == GDK_Up)
if (event->keyval == GDK_Up || event->keyval == GDK_KP_Up)
{
completion->priv->current_selected--;
if (completion->priv->current_selected < 0)
completion->priv->current_selected = 0;
if (completion->priv->current_selected < -1)
completion->priv->current_selected = -1;
}
else
else if (event->keyval == GDK_Down || event->keyval == GDK_KP_Down)
{
completion->priv->current_selected++;
if (completion->priv->current_selected >= matches + actions)
completion->priv->current_selected = 0;
completion->priv->current_selected = matches + actions;
}
else if (event->keyval == GDK_Home || event->keyval == GDK_KP_Home)
completion->priv->current_selected = -1;
else if (event->keyval == GDK_End || event->keyval == GDK_KP_End)
completion->priv->current_selected = matches + actions - 1;
if (completion->priv->current_selected < matches)
if (completion->priv->current_selected < 0)
{
gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (GTK_TREE_VIEW (completion->priv->tree_view)));
gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (GTK_TREE_VIEW (completion->priv->action_view)));
}
else if (completion->priv->current_selected < matches)
{
gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (GTK_TREE_VIEW (completion->priv->action_view)));
......
......@@ -1040,8 +1040,6 @@ _gtk_entry_completion_popup (GtkEntryCompletion *completion)
if (GTK_WIDGET_MAPPED (completion->priv->popup_window))
return;
completion->priv->first_sel_changed = TRUE;
gtk_widget_show_all (completion->priv->vbox);
gdk_window_get_origin (completion->priv->entry->window, &x, &y);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment