|
Blender V4.3
|
#include <UI_grid_view.hh>
Inherits blender::ui::AbstractView.
Inherited by blender::ed::asset::shelf::AssetView.
Public Types | |
| using | ItemIterFn = FunctionRef<void(AbstractGridViewItem &)> |
Public Member Functions | |
| AbstractGridView () | |
| ~AbstractGridView () override=default | |
| void | foreach_item (ItemIterFn iter_fn) const |
| void | foreach_filtered_item (ItemIterFn iter_fn) const |
| template<class ItemT , typename... Args> | |
| ItemT & | add_item (Args &&...args) |
| const GridViewStyle & | get_style () const |
| int | get_item_count () const |
| int | get_item_count_filtered () const |
| void | set_tile_size (int tile_width, int tile_height) |
Public Member Functions inherited from blender::ui::AbstractView | |
| virtual | ~AbstractView ()=default |
| void | register_item (AbstractViewItem &item) |
| virtual std::unique_ptr< DropTargetInterface > | create_drop_target () |
| virtual bool | listen (const wmNotifier &) const |
| virtual bool | begin_filtering (const bContext &C) const |
| virtual void | draw_overlays (const ARegion ®ion, const uiBlock &block) const |
| virtual bool | supports_scrolling () const |
| virtual void | scroll (ViewScrollDirection direction) |
| bool | is_renaming () const |
| bool | begin_renaming () |
| void | end_renaming () |
| Span< char > | get_rename_buffer () const |
| MutableSpan< char > | get_rename_buffer () |
| std::optional< rcti > | get_bounds () const |
| std::string | get_context_menu_title () const |
| void | set_context_menu_title (const std::string &title) |
| bool | get_popup_keep_open () const |
| void | set_popup_keep_open () |
| void | clear_search_highlight () |
Protected Member Functions | |
| virtual void | build_items ()=0 |
Protected Member Functions inherited from blender::ui::AbstractView | |
| AbstractView ()=default | |
| virtual void | change_state_delayed () |
| void | update_from_old (uiBlock &new_block) |
| bool | is_reconstructed () const |
| const AbstractViewItem * | search_highlight_item () const |
| void | filter (std::optional< StringRef > filter_str) |
Protected Attributes | |
| Vector< std::unique_ptr< AbstractGridViewItem > > | items_ |
| std::optional< int > | item_count_filtered_ |
| Map< StringRef, AbstractGridViewItem * > | item_map_ |
| GridViewStyle | style_ |
Friends | |
| class | AbstractGridViewItem |
| class | GridViewBuilder |
| class | GridViewLayoutBuilder |
Definition at line 80 of file UI_grid_view.hh.
| using blender::ui::AbstractGridView::ItemIterFn = FunctionRef<void(AbstractGridViewItem &)> |
Definition at line 98 of file UI_grid_view.hh.
| blender::ui::AbstractGridView::AbstractGridView | ( | ) |
Definition at line 33 of file grid_view.cc.
|
overridedefault |
|
inline |
Convenience wrapper constructing the item by forwarding given arguments to the constructor of the type (ItemT).
E.g. if your grid-item type has the following constructor:
You can add an item like this:
Definition at line 237 of file UI_grid_view.hh.
Referenced by blender::ed::asset::shelf::AssetView::build_items().
|
protectedpure virtual |
Implemented in blender::ed::asset::shelf::AssetView.
Referenced by blender::ui::GridViewBuilder::build_grid_view().
| void blender::ui::AbstractGridView::foreach_filtered_item | ( | ItemIterFn | iter_fn | ) | const |
Definition at line 64 of file grid_view.cc.
References items_.
Referenced by blender::ui::GridViewLayoutBuilder::build_from_view(), blender::ui::find_filtered_item_index(), and get_item_count_filtered().
| void blender::ui::AbstractGridView::foreach_item | ( | ItemIterFn | iter_fn | ) | const |
Definition at line 57 of file grid_view.cc.
References items_.
| int blender::ui::AbstractGridView::get_item_count | ( | ) | const |
Definition at line 102 of file grid_view.cc.
References items_.
Referenced by get_item_count_filtered().
| int blender::ui::AbstractGridView::get_item_count_filtered | ( | ) | const |
Definition at line 107 of file grid_view.cc.
References BLI_assert, foreach_filtered_item(), get_item_count(), and item_count_filtered_.
Referenced by blender::ui::BuildOnlyVisibleButtonsHelper::BuildOnlyVisibleButtonsHelper(), and blender::ui::BuildOnlyVisibleButtonsHelper::fill_layout_after_visible().
| const GridViewStyle & blender::ui::AbstractGridView::get_style | ( | ) | const |
Definition at line 97 of file grid_view.cc.
References style_.
Referenced by blender::ui::GridViewLayoutBuilder::build_from_view(), blender::ed::asset::shelf::AssetViewItem::build_grid_tile(), and blender::ui::PreviewGridItem::build_grid_tile_button().
Definition at line 121 of file grid_view.cc.
References style_, blender::ui::GridViewStyle::tile_height, and blender::ui::GridViewStyle::tile_width.
|
friend |
Definition at line 81 of file UI_grid_view.hh.
|
friend |
Definition at line 82 of file UI_grid_view.hh.
|
friend |
Definition at line 83 of file UI_grid_view.hh.
|
mutableprotected |
Store this to avoid recomputing.
Definition at line 88 of file UI_grid_view.hh.
Referenced by get_item_count_filtered().
|
protected |
<identifier, item> map to lookup items by identifier, used for efficient lookups in update_from_old().
Definition at line 91 of file UI_grid_view.hh.
|
protected |
Definition at line 86 of file UI_grid_view.hh.
Referenced by foreach_filtered_item(), foreach_item(), and get_item_count().
|
protected |
Definition at line 92 of file UI_grid_view.hh.
Referenced by get_style(), and set_tile_size().