summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2013-01-01 11:49:48 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-01 17:33:11 -0800
commitbc16f06536ba0bfbe58660d24243c360e4155f12 (patch)
tree3ad9cd0bea17212e9ae3a691de7d8d94b292d4db /divelist.c
parenta58d470bad755c138a84b5516fa27bf74924e24c (diff)
downloadsubsurface-bc16f06536ba0bfbe58660d24243c360e4155f12.tar.gz
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 <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c2
1 files changed, 2 insertions, 0 deletions
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);