|
Blender V4.5
|
#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 Member Functions | |
| BasicTreeViewItem (StringRef label, BIFIconID icon=ICON_NONE) | |
| void | build_row (uiLayout &row) override |
| void | add_label (uiLayout &layout, StringRefNull label_override="") |
| void | set_on_activate_fn (ActivateFn fn) |
| void | set_is_active_fn (IsActiveFn is_active_fn) |
| Public Member Functions inherited from blender::ui::AbstractTreeViewItem | |
| ~AbstractTreeViewItem () override=default | |
| std::optional< std::string > | debug_name () const override |
| std::unique_ptr< DropTargetInterface > | create_item_drop_target () final |
| virtual std::unique_ptr< TreeViewItemDropTarget > | create_drop_target () |
| AbstractTreeView & | get_tree_view () const |
| std::optional< rctf > | get_win_rect (const ARegion ®ion) const |
| void | begin_renaming () |
| bool | toggle_collapsed () |
| virtual bool | set_collapsed (bool collapsed) |
| virtual void | on_collapse_change (bContext &C, bool is_collapsed) |
| virtual std::optional< bool > | should_be_collapsed () const |
| void | uncollapse_by_default () |
| bool | is_collapsed () const |
| bool | is_collapsible () const |
| int | count_parents () const |
| Public Member Functions inherited from blender::ui::AbstractViewItem | |
| virtual | ~AbstractViewItem ()=default |
| virtual void | build_context_menu (bContext &C, uiLayout &column) const |
| virtual std::unique_ptr< AbstractViewItemDragController > | create_drag_controller () const |
| AbstractView & | get_view () const |
| uiButViewItem * | view_item_button () const |
| void | disable_interaction () |
| bool | is_interactive () const |
| void | disable_activatable () |
| bool | is_active () const |
| bool | is_search_highlight () const |
| void | activate (bContext &C) |
| void | deactivate () |
| virtual bool | supports_renaming () const |
| bool | is_renaming () const |
| void | begin_renaming () |
| void | end_renaming () |
| void | rename_apply (const bContext &C) |
| bool | is_filtered_visible () const |
| Public Member Functions inherited from blender::ui::TreeViewItemContainer | |
| template<class ItemT, typename... Args> | |
| ItemT & | add_tree_item (Args &&...args) |
| AbstractTreeViewItem & | add_tree_item (std::unique_ptr< AbstractTreeViewItem > item) |
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 |
| bool | is_always_collapsible_ = false |
| Protected Attributes inherited from blender::ui::TreeViewItemContainer | |
| Vector< std::unique_ptr< AbstractTreeViewItem > > | children_ |
| TreeViewItemContainer * | root_ = nullptr |
| AbstractTreeViewItem * | parent_ = nullptr |
| bool | is_flat_ = false |
Additional Inherited Members | |
| Protected Member Functions inherited from blender::ui::AbstractTreeViewItem | |
| StringRef | get_rename_string () const override |
| bool | rename (const bContext &C, StringRefNull new_name) override |
| virtual bool | supports_collapsing () const |
| void | toggle_collapsed_from_view (bContext &C) |
| void | change_state_delayed () override |
| bool | matches (const AbstractViewItem &other) const override |
| void | update_from_old (const AbstractViewItem &old) override |
| virtual bool | matches_single (const AbstractTreeViewItem &other) const |
| bool | is_hovered () const |
| void | ensure_parents_uncollapsed () |
| Protected Member Functions inherited from blender::ui::AbstractViewItem | |
| AbstractViewItem ()=default | |
| void | add_rename_button (uiBlock &block) |
| virtual bool | should_be_filtered_visible (StringRefNull filter_string) const |
| Protected Member Functions inherited from blender::ui::TreeViewItemContainer | |
| void | foreach_item_recursive (ItemIterFn iter_fn, IterOptions options=IterOptions::None) const |
| void | foreach_parent (ItemIterFn iter_fn) const |
The most basic type, just a label with an icon.
Definition at line 353 of file UI_tree_view.hh.
| using blender::ui::BasicTreeViewItem::ActivateFn = std::function<void(bContext &C, BasicTreeViewItem &new_active)> |
Definition at line 356 of file UI_tree_view.hh.
| using blender::ui::BasicTreeViewItem::IsActiveFn = std::function<bool()> |
Definition at line 355 of file UI_tree_view.hh.
|
explicit |
Definition at line 1012 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 1022 of file tree_view.cc.
References icon, IFACE_, blender::StringRefBase::is_empty(), uiLayout::label(), blender::ui::AbstractTreeViewItem::label_, and blender::StringRefNull::StringRefNull().
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 1017 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 1040 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 1035 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 374 of file UI_tree_view.hh.
Referenced by set_on_activate_fn().
| BIFIconID blender::ui::BasicTreeViewItem::icon |
Definition at line 357 of file UI_tree_view.hh.
Referenced by add_label(), and BasicTreeViewItem().
|
protected |
Definition at line 376 of file UI_tree_view.hh.
Referenced by set_is_active_fn().