|
Blender V5.0
|
#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 bool | is_fully_visible () const |
| virtual void | scroll (ViewScrollDirection direction) |
| virtual std::optional< uiViewState > | persistent_state () const |
| virtual void | persistent_state_apply (const uiViewState &state) |
| 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 () |
| void | allow_multiselect_items () |
| bool | is_multiselect_supported () const |
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 83 of file UI_grid_view.hh.
| using blender::ui::AbstractGridView::ItemIterFn = FunctionRef<void(AbstractGridViewItem &)> |
Definition at line 101 of file UI_grid_view.hh.
| blender::ui::AbstractGridView::AbstractGridView | ( | ) |
Definition at line 34 of file grid_view.cc.
References style_, UI_preview_tile_size_x(), and UI_preview_tile_size_y().
Referenced by build_items().
|
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 239 of file UI_grid_view.hh.
References add_item().
Referenced by add_item(), blender::ed::asset::shelf::AssetView::build_items(), and build_items().
|
protectedpure virtual |
Implemented in blender::ed::asset::shelf::AssetView.
References AbstractGridView(), AbstractGridViewItem, blender::ui::AbstractView::AbstractView(), blender::ui::AbstractView::AbstractViewItem, and add_item().
Referenced by blender::ui::GridViewBuilder::build_grid_view().
| void blender::ui::AbstractGridView::foreach_filtered_item | ( | ItemIterFn | iter_fn | ) | const |
Definition at line 65 of file grid_view.cc.
References items_.
Referenced by blender::ui::GridViewLayoutBuilder::build_from_view(), and get_item_count_filtered().
| void blender::ui::AbstractGridView::foreach_item | ( | ItemIterFn | iter_fn | ) | const |
Definition at line 58 of file grid_view.cc.
References items_.
| int blender::ui::AbstractGridView::get_item_count | ( | ) | const |
Definition at line 103 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 108 of file grid_view.cc.
References BLI_assert, foreach_filtered_item(), get_item_count(), i, and item_count_filtered_.
Referenced by blender::ui::BuildOnlyVisibleButtonsHelper::BuildOnlyVisibleButtonsHelper().
| const GridViewStyle & blender::ui::AbstractGridView::get_style | ( | ) | const |
Definition at line 98 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().
| void blender::ui::AbstractGridView::set_tile_size | ( | int | tile_width, |
| int | tile_height ) |
Definition at line 122 of file grid_view.cc.
References style_.
|
friend |
Definition at line 84 of file UI_grid_view.hh.
References AbstractGridViewItem.
Referenced by AbstractGridViewItem, and build_items().
|
friend |
Definition at line 85 of file UI_grid_view.hh.
References GridViewBuilder.
Referenced by GridViewBuilder.
|
friend |
Definition at line 86 of file UI_grid_view.hh.
References GridViewLayoutBuilder.
Referenced by GridViewLayoutBuilder.
|
mutableprotected |
Store this to avoid recomputing.
Definition at line 91 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 94 of file UI_grid_view.hh.
|
protected |
Definition at line 89 of file UI_grid_view.hh.
Referenced by foreach_filtered_item(), foreach_item(), and get_item_count().
|
protected |
Definition at line 95 of file UI_grid_view.hh.
Referenced by AbstractGridView(), get_style(), and set_tile_size().