|
Blender V4.3
|
#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_renaming_ = false |
| bool | is_highlighted_search_ = false |
| bool | is_filtered_visible_ = true |
Protected Attributes inherited from blender::ui::TreeViewItemContainer | |
| Vector< std::unique_ptr< AbstractTreeViewItem > > | children_ |
| TreeViewItemContainer * | root_ = nullptr |
| AbstractTreeViewItem * | parent_ = nullptr |
The most basic type, just a label with an icon.
Definition at line 335 of file UI_tree_view.hh.
| using blender::ui::BasicTreeViewItem::ActivateFn = std::function<void(bContext &C, BasicTreeViewItem &new_active)> |
Definition at line 338 of file UI_tree_view.hh.
| using blender::ui::BasicTreeViewItem::IsActiveFn = std::function<bool()> |
Definition at line 337 of file UI_tree_view.hh.
|
explicit |
Definition at line 942 of file tree_view.cc.
References label, and blender::ui::AbstractTreeViewItem::label_.
| void blender::ui::BasicTreeViewItem::add_label | ( | uiLayout & | layout, |
| StringRefNull | label_override = "" ) |
Definition at line 952 of file tree_view.cc.
References icon, IFACE_, blender::StringRefBase::is_empty(), label, blender::ui::AbstractTreeViewItem::label_, and uiItemL().
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 947 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 970 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 965 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 356 of file UI_tree_view.hh.
Referenced by set_on_activate_fn().
| BIFIconID blender::ui::BasicTreeViewItem::icon |
Definition at line 339 of file UI_tree_view.hh.
Referenced by add_label().
|
protected |
Definition at line 358 of file UI_tree_view.hh.
Referenced by set_is_active_fn().