Commit 05a0b0b4 authored by Kristian Rietveld's avatar Kristian Rietveld Committed by Kristian Rietveld

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).
parent 3c6fb888
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
......
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
......
......@@ -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
......
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