Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-12-02 21:40:36 +0300
committerJulian Eisel <julian@blender.org>2021-12-02 21:49:48 +0300
commit56ff9540307e0dee7478bbc4241d5e024ba1d8b3 (patch)
treea6797e258313a69ced9d99513a9a9f95dcd07f5d
parentc0122cc8885b035b90cd8b70d3fe4aba0f5e4f71 (diff)
UI: Expand tree-view items (e.g. asset catalogs) on click to activate
This actually gives a quite nice behavior in my opinion, especially for asset catalogs, where activating a catalog makes all assets inside it or its (grand-)child catalogs visible, so showing the child catalogs then adds useful information. Maybe this should become a feature for asset catalogs only, to be evaluated once the tree-view API is used in more cases. Only asset catalogs are affected by this change right now. Part of T93582.
-rw-r--r--source/blender/editors/interface/tree_view.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/interface/tree_view.cc b/source/blender/editors/interface/tree_view.cc
index b8c07b15bdc..58d76b7d3de 100644
--- a/source/blender/editors/interface/tree_view.cc
+++ b/source/blender/editors/interface/tree_view.cc
@@ -183,6 +183,9 @@ void AbstractTreeViewItem::tree_row_click_fn(struct bContext * /*C*/,
*tree_row_but->tree_item);
tree_item.activate();
+ /* Not only activate the item, also show its children. Maybe this should be optional, or
+ * controlled by the specific tree-view. */
+ tree_item.set_collapsed(false);
}
void AbstractTreeViewItem::add_treerow_button(uiBlock &block)