[Bf-blender-cvs] [56ff9540307] master: UI: Expand tree-view items (e.g. asset catalogs) on click to activate

Julian Eisel noreply at git.blender.org
Thu Dec 2 19:49:54 CET 2021


Commit: 56ff9540307e0dee7478bbc4241d5e024ba1d8b3
Author: Julian Eisel
Date:   Thu Dec 2 19:40:36 2021 +0100
Branches: master
https://developer.blender.org/rB56ff9540307e0dee7478bbc4241d5e024ba1d8b3

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.

===================================================================

M	source/blender/editors/interface/tree_view.cc

===================================================================

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)



More information about the Bf-blender-cvs mailing list