54template<
typename AssetLibraryListItemType,
55 typename AssetLibraryRepoItemType = AssetLibraryListItemType>
64 AssetLibraryRepoItemType *repo_parent =
nullptr;
69 if (
library.is_extension_repo()) {
71 repo_parent->disable_activatable();
75 if (repo_parent &&
library.extension_repo == repo_parent->library.extension_repo) {
78 if constexpr (std::is_same_v<AssetLibraryListItemType, AssetLibraryListItem>) {
79 const bool project_library =
library.user_library &&
81 if (project_library) {
85 parent = project_group;
90 this->
is_flat_ = (!repo_parent && !project_group);
94template<
typename AssetLibraryListItemType,
95 typename AssetLibraryRepoItemType = AssetLibraryListItemType>
115 const AnyAssetLibraryDefinition &library);
Abstract base class for defining a customizable tree-view item.
void set_default_rows(int default_rows)
static void build_tree_view(const bContext &C, AbstractTreeView &tree_view, Layout &layout, bool add_box=true)
ItemT & add_tree_item(Args &&...args)
AbstractGridView * block_add_view(Block &block, StringRef idname, std::unique_ptr< AbstractGridView > grid_view)
TreeViewItemContainer TreeViewOrItem
void draw_library_list(const bContext &C, ui::Layout &layout, Vector< AnyAssetLibraryDefinition > &libraries, StringRef view_description)
@ ASSET_LIBRARY_PROJECT_DEFINED
void draw_active_library_settings(const bContext *C, ui::Layout &layout, const AnyAssetLibraryDefinition &library)
bUserAssetLibrary * user_library
bUserExtensionRepo * extension_repo
bool is_extension_repo() const
bool supports_renaming() const override
bool rename(const bContext &C, StringRefNull new_name) override
AssetLibraryListItemCommon(const AnyAssetLibraryDefinition &library, const int index_in_list)
AnyAssetLibraryDefinition library
void build_tree() override
AssetLibraryList(const Vector< AnyAssetLibraryDefinition > libraries)
Vector< AnyAssetLibraryDefinition > libraries
AssetLibraryProjectHeading()=default
void build_row(ui::Layout &row) override