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.
This commit is contained in:
Julian Eisel 2021-12-02 19:40:36 +01:00
parent c0122cc888
commit 56ff954030
1 changed files with 3 additions and 0 deletions

View File

@ -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)