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-04 17:17:59 +0300
committerJulian Eisel <julian@blender.org>2021-10-04 18:03:12 +0300
commit2b6f2072f1eecd43080821bb7b55f5313f890ddb (patch)
tree54ec409e85c4322e5968a7cf3be457c29af897d0 /source/blender/editors/space_file/asset_catalog_tree_view.cc
parent4fd7ce321d7352570a5cbb08d66b1c635d234689 (diff)
UI Tree-View API: Enforce active item to be un-collapsed
Makes sure that the active item of a tree never has collapsed parent items, which can be confusing if it happens. E.g. for the asset catalogs UI, the active catalog decides which assets are visible. Having it hidden while being the main factor deciding which assets are visible is quite confusing. I think it makes sense to have this at the UI Tree-View level, rather than doing it manually in the asset catalog code for example. Seems like something you'd commonly want. We can make it optional in the API if needed. Renamed the `set_active()` function to make clear that it is more than a mere setter.
Diffstat (limited to 'source/blender/editors/space_file/asset_catalog_tree_view.cc')
-rw-r--r--source/blender/editors/space_file/asset_catalog_tree_view.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_file/asset_catalog_tree_view.cc b/source/blender/editors/space_file/asset_catalog_tree_view.cc
index 883bc6d7890..657881bdb40 100644
--- a/source/blender/editors/space_file/asset_catalog_tree_view.cc
+++ b/source/blender/editors/space_file/asset_catalog_tree_view.cc
@@ -152,7 +152,7 @@ ui::BasicTreeViewItem &AssetCatalogTreeView::build_catalog_items_recursive(
ui::BasicTreeViewItem &view_item = view_parent_item.add_tree_item<AssetCatalogTreeViewItem>(
&catalog);
if (is_active_catalog(catalog.get_catalog_id())) {
- view_item.set_active();
+ view_item.activate();
}
catalog.foreach_child([&view_item, this](AssetCatalogTreeItem &child) {
@@ -171,7 +171,7 @@ void AssetCatalogTreeView::add_all_item()
WM_main_add_notifier(NC_SPACE | ND_SPACE_ASSET_PARAMS, nullptr);
});
if (params->asset_catalog_visibility == FILE_SHOW_ASSETS_ALL_CATALOGS) {
- item.set_active();
+ item.activate();
}
}
@@ -185,7 +185,7 @@ void AssetCatalogTreeView::add_unassigned_item()
WM_main_add_notifier(NC_SPACE | ND_SPACE_ASSET_PARAMS, nullptr);
});
if (params->asset_catalog_visibility == FILE_SHOW_ASSETS_WITHOUT_CATALOG) {
- item.set_active();
+ item.activate();
}
}