Make Shift-P and Shift-N activate typeahead in GtkTreeView (i.e. they are

2006-03-10  Federico Mena Quintero  <federico@novell.com>

	Make Shift-P and Shift-N activate typeahead in GtkTreeView
	(i.e. they are just normal capital letters).  Fixes bug #334098.

	* gtk/gtktreeview.c (gtk_tree_view_add_move_binding): Add an
	"add_shifted_binding" argument which determines whether we'll add
	the same binding with GDK_SHIFT_MASK.
	(gtk_tree_view_class_init): Use add_shifted_binding=FALSE for GDK_p
	and GDK_n; use TRUE for all the rest.
This commit is contained in:
Federico Mena Quintero 2006-03-10 17:16:50 +00:00 committed by Federico Mena Quintero
parent 3ac02d3215
commit bb7fd9549b
3 changed files with 43 additions and 18 deletions

View File

@ -1,3 +1,14 @@
2006-03-10 Federico Mena Quintero <federico@novell.com>
Make Shift-P and Shift-N activate typeahead in GtkTreeView
(i.e. they are just normal capital letters). Fixes bug #334098.
* gtk/gtktreeview.c (gtk_tree_view_add_move_binding): Add an
"add_shifted_binding" argument which determines whether we'll add
the same binding with GDK_SHIFT_MASK.
(gtk_tree_view_class_init): Use add_shifted_binding=FALSE for GDK_p
and GDK_n; use TRUE for all the rest.
2006-03-10 Michael Natterer <mitch@imendio.com>
* gtk/gtkentry.[ch]: applied refactored patch from maemo-gtk that

View File

@ -1,3 +1,14 @@
2006-03-10 Federico Mena Quintero <federico@novell.com>
Make Shift-P and Shift-N activate typeahead in GtkTreeView
(i.e. they are just normal capital letters). Fixes bug #334098.
* gtk/gtktreeview.c (gtk_tree_view_add_move_binding): Add an
"add_shifted_binding" argument which determines whether we'll add
the same binding with GDK_SHIFT_MASK.
(gtk_tree_view_class_init): Use add_shifted_binding=FALSE for GDK_p
and GDK_n; use TRUE for all the rest.
2006-03-10 Michael Natterer <mitch@imendio.com>
* gtk/gtkentry.[ch]: applied refactored patch from maemo-gtk that

View File

@ -303,6 +303,7 @@ static gboolean gtk_tree_view_is_expander_column (GtkTreeView
static void gtk_tree_view_add_move_binding (GtkBindingSet *binding_set,
guint keyval,
guint modmask,
gboolean add_shifted_binding,
GtkMovementStep step,
gint count);
static gint gtk_tree_view_unref_and_check_selection_tree (GtkTreeView *tree_view,
@ -946,40 +947,40 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
G_TYPE_BOOLEAN, 0);
/* Key bindings */
gtk_tree_view_add_move_binding (binding_set, GDK_Up, 0,
gtk_tree_view_add_move_binding (binding_set, GDK_Up, 0, TRUE,
GTK_MOVEMENT_DISPLAY_LINES, -1);
gtk_tree_view_add_move_binding (binding_set, GDK_KP_Up, 0,
gtk_tree_view_add_move_binding (binding_set, GDK_KP_Up, 0, TRUE,
GTK_MOVEMENT_DISPLAY_LINES, -1);
gtk_tree_view_add_move_binding (binding_set, GDK_Down, 0,
gtk_tree_view_add_move_binding (binding_set, GDK_Down, 0, TRUE,
GTK_MOVEMENT_DISPLAY_LINES, 1);
gtk_tree_view_add_move_binding (binding_set, GDK_KP_Down, 0,
gtk_tree_view_add_move_binding (binding_set, GDK_KP_Down, 0, TRUE,
GTK_MOVEMENT_DISPLAY_LINES, 1);
gtk_tree_view_add_move_binding (binding_set, GDK_p, GDK_CONTROL_MASK,
gtk_tree_view_add_move_binding (binding_set, GDK_p, GDK_CONTROL_MASK, FALSE,
GTK_MOVEMENT_DISPLAY_LINES, -1);
gtk_tree_view_add_move_binding (binding_set, GDK_n, GDK_CONTROL_MASK,
gtk_tree_view_add_move_binding (binding_set, GDK_n, GDK_CONTROL_MASK, FALSE,
GTK_MOVEMENT_DISPLAY_LINES, 1);
gtk_tree_view_add_move_binding (binding_set, GDK_Home, 0,
gtk_tree_view_add_move_binding (binding_set, GDK_Home, 0, TRUE,
GTK_MOVEMENT_BUFFER_ENDS, -1);
gtk_tree_view_add_move_binding (binding_set, GDK_KP_Home, 0,
gtk_tree_view_add_move_binding (binding_set, GDK_KP_Home, 0, TRUE,
GTK_MOVEMENT_BUFFER_ENDS, -1);
gtk_tree_view_add_move_binding (binding_set, GDK_End, 0,
gtk_tree_view_add_move_binding (binding_set, GDK_End, 0, TRUE,
GTK_MOVEMENT_BUFFER_ENDS, 1);
gtk_tree_view_add_move_binding (binding_set, GDK_KP_End, 0,
gtk_tree_view_add_move_binding (binding_set, GDK_KP_End, 0, TRUE,
GTK_MOVEMENT_BUFFER_ENDS, 1);
gtk_tree_view_add_move_binding (binding_set, GDK_Page_Up, 0,
gtk_tree_view_add_move_binding (binding_set, GDK_Page_Up, 0, TRUE,
GTK_MOVEMENT_PAGES, -1);
gtk_tree_view_add_move_binding (binding_set, GDK_KP_Page_Up, 0,
gtk_tree_view_add_move_binding (binding_set, GDK_KP_Page_Up, 0, TRUE,
GTK_MOVEMENT_PAGES, -1);
gtk_tree_view_add_move_binding (binding_set, GDK_Page_Down, 0,
gtk_tree_view_add_move_binding (binding_set, GDK_Page_Down, 0, TRUE,
GTK_MOVEMENT_PAGES, 1);
gtk_tree_view_add_move_binding (binding_set, GDK_KP_Page_Down, 0,
gtk_tree_view_add_move_binding (binding_set, GDK_KP_Page_Down, 0, TRUE,
GTK_MOVEMENT_PAGES, 1);
@ -8084,6 +8085,7 @@ static void
gtk_tree_view_add_move_binding (GtkBindingSet *binding_set,
guint keyval,
guint modmask,
gboolean add_shifted_binding,
GtkMovementStep step,
gint count)
{
@ -8093,10 +8095,11 @@ gtk_tree_view_add_move_binding (GtkBindingSet *binding_set,
G_TYPE_ENUM, step,
G_TYPE_INT, count);
gtk_binding_entry_add_signal (binding_set, keyval, GDK_SHIFT_MASK,
"move_cursor", 2,
G_TYPE_ENUM, step,
G_TYPE_INT, count);
if (add_shifted_binding)
gtk_binding_entry_add_signal (binding_set, keyval, GDK_SHIFT_MASK,
"move_cursor", 2,
G_TYPE_ENUM, step,
G_TYPE_INT, count);
if ((modmask & GDK_CONTROL_MASK) == GDK_CONTROL_MASK)
return;