[gnome-builder] project-tree: refresh tree when node is expanded
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] project-tree: refresh tree when node is expanded
- Date: Wed, 29 Nov 2017 01:04:47 +0000 (UTC)
commit 81ddccb806aa6b3507f440bd888d6bcd454cfa6a
Author: Christian Hergert <chergert redhat com>
Date: Tue Nov 28 17:04:31 2017 -0800
project-tree: refresh tree when node is expanded
This actually works in the opposite fashion of the byline. What this does
is remove all the children when the node is collapsed, and marks it for
rebuild. That way, it gets rebuilt in the normal fashion when the node is
expanded (and ensures we have a common flow for both cases now).
src/plugins/project-tree/gb-project-tree-builder.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/project-tree/gb-project-tree-builder.c
b/src/plugins/project-tree/gb-project-tree-builder.c
index 8e8fe8b..32893a1 100644
--- a/src/plugins/project-tree/gb-project-tree-builder.c
+++ b/src/plugins/project-tree/gb-project-tree-builder.c
@@ -78,6 +78,7 @@ build_context (GbProjectTreeBuilder *self,
"item", item,
"icon-name", "folder-symbolic",
"expanded-icon-name", "folder-open-symbolic",
+ "reset-on-collapse", TRUE,
NULL);
g_object_bind_property (project, "name", child, "text", G_BINDING_SYNC_CREATE);
dzl_tree_node_append (node, child);
@@ -195,7 +196,10 @@ build_file (GbProjectTreeBuilder *self,
dzl_tree_node_insert_sorted (node, child, compare_nodes_func, self);
if (g_file_info_get_file_type (item_file_info) == G_FILE_TYPE_DIRECTORY)
- dzl_tree_node_set_children_possible (child, TRUE);
+ {
+ dzl_tree_node_set_children_possible (child, TRUE);
+ dzl_tree_node_set_reset_on_collapse (child, TRUE);
+ }
count++;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]