New keybinding. (gtk_tree_view_focus): Fix merge conflict.

Fri Jun  8 19:49:29 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): New
	keybinding.
	(gtk_tree_view_focus): Fix merge conflict.
This commit is contained in:
Jonathan Blandford 2001-06-08 23:51:21 +00:00 committed by Jonathan Blandford
parent f92ccfc08c
commit a055d0620d
9 changed files with 97 additions and 5 deletions

View File

@ -1,3 +1,9 @@
Fri Jun 8 19:49:29 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): New
keybinding.
(gtk_tree_view_focus): Fix merge conflict.
Fri Jun 8 18:41:30 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_set_cursor): new function to

View File

@ -1,3 +1,9 @@
Fri Jun 8 19:49:29 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): New
keybinding.
(gtk_tree_view_focus): Fix merge conflict.
Fri Jun 8 18:41:30 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_set_cursor): new function to

View File

@ -1,3 +1,9 @@
Fri Jun 8 19:49:29 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): New
keybinding.
(gtk_tree_view_focus): Fix merge conflict.
Fri Jun 8 18:41:30 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_set_cursor): new function to

View File

@ -1,3 +1,9 @@
Fri Jun 8 19:49:29 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): New
keybinding.
(gtk_tree_view_focus): Fix merge conflict.
Fri Jun 8 18:41:30 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_set_cursor): new function to

View File

@ -1,3 +1,9 @@
Fri Jun 8 19:49:29 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): New
keybinding.
(gtk_tree_view_focus): Fix merge conflict.
Fri Jun 8 18:41:30 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_set_cursor): new function to

View File

@ -1,3 +1,9 @@
Fri Jun 8 19:49:29 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): New
keybinding.
(gtk_tree_view_focus): Fix merge conflict.
Fri Jun 8 18:41:30 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_set_cursor): new function to

View File

@ -1,3 +1,9 @@
Fri Jun 8 19:49:29 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row): New
keybinding.
(gtk_tree_view_focus): Fix merge conflict.
Fri Jun 8 18:41:30 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_set_cursor): new function to

View File

@ -101,6 +101,7 @@ enum
BEGIN_FREE_MOTION,
END_FREE_MOTION,
MOVE_CURSOR,
SELECT_CURSOR_ROW,
TOGGLE_CURSOR_ROW,
EXPAND_COLLAPSE_CURSOR_ROW,
SELECT_CURSOR_PARENT,
@ -224,6 +225,7 @@ static void gtk_tree_view_real_end_free_motion (GtkTreeView *tree
static void gtk_tree_view_real_move_cursor (GtkTreeView *tree_view,
GtkMovementStep step,
gint count);
static void gtk_tree_view_real_select_cursor_row (GtkTreeView *tree_view);
static void gtk_tree_view_real_toggle_cursor_row (GtkTreeView *tree_view);
static void gtk_tree_view_real_expand_collapse_cursor_row (GtkTreeView *tree_view,
gboolean logical,
@ -435,6 +437,7 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
class->begin_free_motion = gtk_tree_view_real_begin_free_motion;
class->end_free_motion = gtk_tree_view_real_end_free_motion;
class->move_cursor = gtk_tree_view_real_move_cursor;
class->select_cursor_row = gtk_tree_view_real_select_cursor_row;
class->toggle_cursor_row = gtk_tree_view_real_toggle_cursor_row;
class->expand_collapse_cursor_row = gtk_tree_view_real_expand_collapse_cursor_row;
class->select_cursor_parent = gtk_tree_view_real_select_cursor_parent;
@ -646,6 +649,15 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
gtk_marshal_VOID__ENUM_INT,
GTK_TYPE_NONE, 2, GTK_TYPE_MOVEMENT_STEP, GTK_TYPE_INT);
tree_view_signals[SELECT_CURSOR_ROW] =
g_signal_newc ("select_cursor_row",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST | GTK_RUN_ACTION,
G_STRUCT_OFFSET (GtkTreeViewClass, select_cursor_row),
NULL, NULL,
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
tree_view_signals[TOGGLE_CURSOR_ROW] =
g_signal_newc ("toggle_cursor_row",
G_TYPE_FROM_CLASS (object_class),
@ -707,11 +719,13 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
gtk_tree_view_add_move_binding (binding_set, GDK_Page_Down, 0,
GTK_MOVEMENT_PAGES, 1);
gtk_tree_view_add_move_binding (binding_set, GDK_Right, 0,
GTK_MOVEMENT_VISUAL_POSITIONS, 1);
gtk_tree_view_add_move_binding (binding_set, GDK_Left, 0,
GTK_MOVEMENT_VISUAL_POSITIONS, -1);
gtk_binding_entry_add_signal (binding_set, GDK_Right, 0, "move_cursor", 2,
GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS,
GTK_TYPE_INT, 1);
gtk_binding_entry_add_signal (binding_set, GDK_Left, 0, "move_cursor", 2,
GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS,
GTK_TYPE_INT, -1);
gtk_binding_entry_add_signal (binding_set, GDK_f, GDK_CONTROL_MASK, "move_cursor", 2,
GTK_TYPE_ENUM, GTK_MOVEMENT_LOGICAL_POSITIONS,
@ -723,6 +737,8 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK, "toggle_cursor_row", 0);
gtk_binding_entry_add_signal (binding_set, GDK_space, 0, "select_cursor_row", 0);
/* expand and collapse rows */
gtk_binding_entry_add_signal (binding_set, GDK_plus, 0, "expand_collapse_cursor_row", 3,
GTK_TYPE_BOOL, FALSE,
@ -3927,6 +3943,7 @@ gtk_tree_view_focus (GtkWidget *widget,
{
GtkTreeView *tree_view;
GtkWidget *focus_child;
GtkContainer *container;
g_return_val_if_fail (GTK_IS_TREE_VIEW (widget), FALSE);
g_return_val_if_fail (GTK_WIDGET_VISIBLE (widget), FALSE);
@ -5705,6 +5722,38 @@ gtk_tree_view_move_cursor_start_end (GtkTreeView *tree_view,
gtk_tree_view_clamp_node_visible (tree_view, cursor_tree, cursor_node);
}
static void
gtk_tree_view_real_select_cursor_row (GtkTreeView *tree_view)
{
GtkRBTree *cursor_tree = NULL;
GtkRBNode *cursor_node = NULL;
GtkTreePath *cursor_path = NULL;
cursor_path = NULL;
if (tree_view->priv->cursor)
cursor_path = gtk_tree_row_reference_get_path (tree_view->priv->cursor);
if (cursor_path == NULL)
return;
_gtk_tree_view_find_node (tree_view, cursor_path,
&cursor_tree, &cursor_node);
if (cursor_tree == NULL)
return;
_gtk_tree_selection_internal_select_node (tree_view->priv->selection,
cursor_node,
cursor_tree,
cursor_path,
0);
gtk_tree_view_clamp_node_visible (tree_view, cursor_tree, cursor_node);
gtk_widget_grab_focus (GTK_WIDGET (tree_view));
gtk_tree_view_queue_draw_path (tree_view, cursor_path, NULL);
gtk_tree_path_free (cursor_path);
}
static void
gtk_tree_view_real_toggle_cursor_row (GtkTreeView *tree_view)
{

View File

@ -86,6 +86,7 @@ struct _GtkTreeViewClass
void (* move_cursor) (GtkTreeView *tree_view,
GtkMovementStep step,
gint count);
void (* select_cursor_row) (GtkTreeView *tree_view);
void (* toggle_cursor_row) (GtkTreeView *tree_view);
void (* expand_collapse_cursor_row) (GtkTreeView *tree_view,
gboolean logical,