[devhelp] BookTree: add a comment in select_uri()
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp] BookTree: add a comment in select_uri()
- Date: Fri, 18 May 2018 20:34:34 +0000 (UTC)
commit 0f00ee7f4a28477abaee2f139cc56a90da759fd7
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri May 18 22:30:16 2018 +0200
BookTree: add a comment in select_uri()
devhelp/dh-book-tree.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/devhelp/dh-book-tree.c b/devhelp/dh-book-tree.c
index 1b03b3e..d1b17db 100644
--- a/devhelp/dh-book-tree.c
+++ b/devhelp/dh-book-tree.c
@@ -1024,12 +1024,16 @@ dh_book_tree_select_uri (DhBookTree *tree,
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree));
- /* Do not re-select/expand/scroll if already there. */
+ /* Do not re-expand/select/scroll if already there. */
if (gtk_tree_selection_iter_is_selected (selection, &data.iter))
goto out;
+ /* The order is important here: select_iter() doesn't work if the row is
+ * hidden.
+ */
gtk_tree_view_expand_to_path (GTK_TREE_VIEW (tree), data.path);
gtk_tree_selection_select_iter (selection, &data.iter);
+
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (tree),
data.path, NULL,
FALSE, 0.0, 0.0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]