select the current focus row if nothing is selected and ctrl is not

2006-05-29  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeview.c (gtk_tree_view_move_cursor_up_down): select
	the current focus row if nothing is selected and ctrl is not pressed.
	(Fixes #324480, Murray Cumming/Srirama Sharma).
This commit is contained in:
Kristian Rietveld 2006-05-28 23:34:47 +00:00 committed by Kristian Rietveld
parent 3c6fb8881c
commit 05a0b0b4fb
3 changed files with 29 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2006-05-29 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_up_down): select
the current focus row if nothing is selected and ctrl is not pressed.
(Fixes #324480, Murray Cumming/Srirama Sharma).
2006-05-28 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_cell_focus): refactor

View File

@ -1,3 +1,9 @@
2006-05-29 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_up_down): select
the current focus row if nothing is selected and ctrl is not pressed.
(Fixes #324480, Murray Cumming/Srirama Sharma).
2006-05-28 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_cell_focus): refactor

View File

@ -8755,6 +8755,7 @@ static void
gtk_tree_view_move_cursor_up_down (GtkTreeView *tree_view,
gint count)
{
gint selection_count;
GtkRBTree *cursor_tree = NULL;
GtkRBNode *cursor_node = NULL;
GtkRBTree *new_cursor_tree = NULL;
@ -8777,12 +8778,23 @@ gtk_tree_view_move_cursor_up_down (GtkTreeView *tree_view,
if (cursor_tree == NULL)
/* FIXME: we lost the cursor; should we get the first? */
return;
if (count == -1)
_gtk_rbtree_prev_full (cursor_tree, cursor_node,
&new_cursor_tree, &new_cursor_node);
selection_count = gtk_tree_selection_count_selected_rows (tree_view->priv->selection);
if (selection_count == 0 && !tree_view->priv->ctrl_pressed)
{
new_cursor_tree = cursor_tree;
new_cursor_node = cursor_node;
}
else
_gtk_rbtree_next_full (cursor_tree, cursor_node,
&new_cursor_tree, &new_cursor_node);
{
if (count == -1)
_gtk_rbtree_prev_full (cursor_tree, cursor_node,
&new_cursor_tree, &new_cursor_node);
else
_gtk_rbtree_next_full (cursor_tree, cursor_node,
&new_cursor_tree, &new_cursor_node);
}
/*
* If the list has only one item and multi-selection is set then select