From bc16f06536ba0bfbe58660d24243c360e4155f12 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Tue, 1 Jan 2013 11:49:48 -0800 Subject: Keep the selected dive visible in the divelist This patch makes the divelist behave more as you would expect it as you scroll up and down through its entries. Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- divelist.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/divelist.c b/divelist.c index 2240ff40e..602c3bc96 100644 --- a/divelist.c +++ b/divelist.c @@ -2682,6 +2682,7 @@ void select_next_dive(void) } treepath = gtk_tree_model_get_path(MODEL(dive_list), nextiter); gtk_tree_view_expand_to_path(GTK_TREE_VIEW(dive_list.tree_view), treepath); + gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(dive_list.tree_view), treepath, NULL, FALSE, 0, 0); gtk_tree_selection_select_iter(selection, nextiter); gtk_tree_selection_unselect_iter(selection, iter); gtk_tree_path_free(treepath); @@ -2722,6 +2723,7 @@ void select_prev_dive(void) return; } gtk_tree_view_expand_to_path(GTK_TREE_VIEW(dive_list.tree_view), treepath); + gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(dive_list.tree_view), treepath, NULL, FALSE, 0, 0); gtk_tree_selection_select_iter(selection, &previter); gtk_tree_selection_unselect_iter(selection, iter); gtk_tree_path_free(treepath); -- cgit v1.2.3-70-g09d2