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-10-27 18:38:59 +0300
committerJulian Eisel <julian@blender.org>2021-10-27 19:09:00 +0300
commit487faed6d0a1170a2f098552f794280fabe82186 (patch)
treeb8d8fedaff9421a924afbae9faeb23f2b8d24be1 /source/blender/editors/include
parentdefc1b8e1815155840cff1736523760083a05807 (diff)
Asset Browser: Ensure parent catalogs are expanded when adding child
When pressing the '+' icon to add a new child catalog, or when adding it through the context menu, the new catalog should be visible. So the this change makes sure the parent is uncollapsed if needed.
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r--source/blender/editors/include/UI_tree_view.hh11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/include/UI_tree_view.hh b/source/blender/editors/include/UI_tree_view.hh
index 0d18eedeac9..77472979beb 100644
--- a/source/blender/editors/include/UI_tree_view.hh
+++ b/source/blender/editors/include/UI_tree_view.hh
@@ -196,6 +196,15 @@ class AbstractTreeView : public TreeViewItemContainer {
* the actual state changes are done in a delayed manner through this function.
*/
void change_state_delayed();
+ /**
+ * Typically when adding a new child from the UI, the parent should be expanded to make the new
+ * item visible. While this isn't totally bullet proof (items may be expanded where the child was
+ * added dynamically, not through user action), it should give the wanted behavior as needed in
+ * practice.
+ * "Focused" here means active or hovered, as a way to tell if the new item came from user
+ * interaction (on the row directly or through the context menu).
+ */
+ void unveil_new_items_in_focused_parent() const;
void build_layout_from_tree(const TreeViewLayoutBuilder &builder);
};
@@ -223,6 +232,8 @@ class AbstractTreeViewItem : public TreeViewItemContainer {
bool is_open_ = false;
bool is_active_ = false;
bool is_renaming_ = false;
+ /* Could the item be identified from a previous redraw? */
+ bool is_new_ = true;
IsActiveFn is_active_fn_;