Commit bb7fd954 authored by Federico Mena Quintero's avatar Federico Mena Quintero Committed by Federico Mena Quintero
Browse files

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.
parent 3ac02d32
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
......
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
......
......@@ -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;
......
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