|
Blender V5.0
|
#include <UI_tree_view.hh>
Inherits blender::ui::AbstractTreeViewItem.
Inherited by blender::ed::asset::shelf::AssetCatalogSelectorTree::Item, blender::ed::asset_browser::AssetCatalogTreeViewAllItem, blender::ed::asset_browser::AssetCatalogTreeViewItem, and blender::ed::asset_browser::AssetCatalogTreeViewUnassignedItem.
Public Types | |
| using | IsActiveFn = std::function<bool()> |
| using | ActivateFn = std::function<void(bContext &C, BasicTreeViewItem &new_active)> |
| Public Types inherited from blender::ui::TreeViewItemContainer | |
| enum class | IterOptions { None = 0 , SkipCollapsed = 1 << 0 , SkipFiltered = 1 << 1 } |
| using | ItemIterFn = FunctionRef<void(AbstractTreeViewItem &)> |
Public Attributes | |
| BIFIconID | icon |
Protected Attributes | |
| ActivateFn | activate_fn_ |
| IsActiveFn | is_active_fn_ |
| Protected Attributes inherited from blender::ui::AbstractTreeViewItem | |
| std::string | label_ |
| Protected Attributes inherited from blender::ui::AbstractViewItem | |
| AbstractView * | view_ = nullptr |
| uiButViewItem * | view_item_but_ = nullptr |
| bool | is_activatable_ = true |
| bool | is_interactive_ = true |
| bool | is_active_ = false |
| bool | is_selected_ = false |
| bool | is_renaming_ = false |
| bool | is_highlighted_search_ = false |
| bool | is_filtered_visible_ = true |
| bool | is_always_collapsible_ = false |
| bool | select_on_click_ = false |
| bool | reactivate_on_click_ = false |
| bool | activate_for_context_menu_ = false |
| Protected Attributes inherited from blender::ui::TreeViewItemContainer | |
| Vector< std::unique_ptr< AbstractTreeViewItem > > | children_ |
| TreeViewItemContainer * | root_ = nullptr |
| AbstractTreeViewItem * | parent_ = nullptr |
| bool | is_flat_ = false |
The most basic type, just a label with an icon.
Definition at line 365 of file UI_tree_view.hh.
| using blender::ui::BasicTreeViewItem::ActivateFn = std::function<void(bContext &C, BasicTreeViewItem &new_active)> |
Definition at line 368 of file UI_tree_view.hh.
| using blender::ui::BasicTreeViewItem::IsActiveFn = std::function<bool()> |
Definition at line 367 of file UI_tree_view.hh.
|
explicit |
Definition at line 1109 of file tree_view.cc.
References icon, and blender::ui::AbstractTreeViewItem::label_.
Referenced by blender::ed::asset_browser::AssetCatalogTreeViewItem::AssetCatalogTreeViewItem(), and blender::ed::asset::shelf::AssetCatalogSelectorTree::Item::Item().
| void blender::ui::BasicTreeViewItem::add_label | ( | uiLayout & | layout, |
| StringRefNull | label_override = "" ) |
Definition at line 1119 of file tree_view.cc.
References icon, blender::StringRefBase::is_empty(), uiLayout::label(), and blender::ui::AbstractTreeViewItem::label_.
Referenced by blender::ed::asset_browser::AssetCatalogTreeViewItem::build_row(), and build_row().
|
overridevirtual |
Implements blender::ui::AbstractTreeViewItem.
Reimplemented in blender::ed::asset::shelf::AssetCatalogSelectorTree::Item.
Definition at line 1114 of file tree_view.cc.
References add_label().
| void blender::ui::BasicTreeViewItem::set_is_active_fn | ( | IsActiveFn | is_active_fn | ) |
Set a custom callback to check if this item should be active.
Definition at line 1137 of file tree_view.cc.
References is_active_fn_.
Referenced by blender::ed::asset::shelf::AssetCatalogTreeView::build_catalog_items_recursive().
| void blender::ui::BasicTreeViewItem::set_on_activate_fn | ( | ActivateFn | fn | ) |
Definition at line 1132 of file tree_view.cc.
References activate_fn_.
Referenced by blender::ed::asset::shelf::AssetCatalogTreeView::build_catalog_items_recursive().
|
protected |
Called when activating this tree view item. This way users don't have to sub-class BasicTreeViewItem, just to implement custom activation behavior (a common thing to do).
Definition at line 386 of file UI_tree_view.hh.
Referenced by set_on_activate_fn().
| BIFIconID blender::ui::BasicTreeViewItem::icon |
Definition at line 369 of file UI_tree_view.hh.
Referenced by add_label(), and BasicTreeViewItem().
|
protected |
Definition at line 388 of file UI_tree_view.hh.
Referenced by set_is_active_fn().