|
Blender V5.0
|
#include <UI_grid_view.hh>
Inherits blender::ui::AbstractGridViewItem.
Inherited by blender::ed::asset::shelf::AssetViewItem.
Public Types | |
| using | IsActiveFn = std::function<bool()> |
| using | ActivateFn = std::function<void(bContext &C, PreviewGridItem &new_active)> |
Public Attributes | |
| std::string | label |
| int | preview_icon_id = ICON_NONE |
Protected Attributes | |
| ActivateFn | activate_fn_ |
| IsActiveFn | is_active_fn_ |
| bool | hide_label_ = false |
| Protected Attributes inherited from blender::ui::AbstractGridViewItem | |
| std::string | identifier_ {} |
| 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 |
Additional Inherited Members | |
| Protected Member Functions inherited from blender::ui::AbstractGridViewItem | |
| AbstractGridViewItem (StringRef identifier) | |
| bool | matches (const AbstractViewItem &other) const override |
| std::unique_ptr< DropTargetInterface > | create_item_drop_target () final |
| virtual std::unique_ptr< GridViewItemDropTarget > | create_drop_target () |
| Protected Member Functions inherited from blender::ui::AbstractViewItem | |
| AbstractViewItem ()=default | |
| virtual void | update_from_old (const AbstractViewItem &old) |
| virtual void | change_state_delayed () |
| void | add_rename_button (uiBlock &block) |
| virtual bool | should_be_filtered_visible (StringRefNull filter_string) const |
A grid item that shows preview image icons at a nicely readable size (multiple of the normal UI unit size).
Definition at line 194 of file UI_grid_view.hh.
| using blender::ui::PreviewGridItem::ActivateFn = std::function<void(bContext &C, PreviewGridItem &new_active)> |
Definition at line 197 of file UI_grid_view.hh.
| using blender::ui::PreviewGridItem::IsActiveFn = std::function<bool()> |
Definition at line 196 of file UI_grid_view.hh.
| blender::ui::PreviewGridItem::PreviewGridItem | ( | StringRef | identifier, |
| StringRef | label, | ||
| int | preview_icon_id ) |
Definition at line 466 of file grid_view.cc.
References blender::ui::AbstractGridViewItem::AbstractGridViewItem(), label, and preview_icon_id.
Referenced by blender::ed::asset::shelf::AssetViewItem::AssetViewItem().
|
overridevirtual |
Implements blender::ui::AbstractGridViewItem.
Definition at line 502 of file grid_view.cc.
References build_grid_tile_button().
| void blender::ui::PreviewGridItem::build_grid_tile_button | ( | uiLayout & | layout, |
| BIFIconID | override_preview_icon_id = ICON_NONE ) const |
Definition at line 471 of file grid_view.cc.
References uiLayout::block(), blender::ui::AbstractGridView::get_style(), blender::ui::AbstractGridViewItem::get_view(), hide_label_, label, blender::ui::None, preview_icon_id, PreviewTile, blender::ui::GridViewStyle::tile_height, blender::ui::GridViewStyle::tile_width, UI_but_func_quick_tooltip_set(), UI_BUT_ICON_PREVIEW, ui_def_but_icon(), UI_HAS_ICON, uiDefBut(), and blender::ui::AbstractViewItem::view_item_button().
Referenced by blender::ed::asset::shelf::AssetViewItem::build_grid_tile(), and build_grid_tile().
| void blender::ui::PreviewGridItem::hide_label | ( | ) |
Definition at line 517 of file grid_view.cc.
References hide_label_.
Referenced by blender::ed::asset::shelf::AssetView::build_items().
| void blender::ui::PreviewGridItem::set_is_active_fn | ( | IsActiveFn | fn | ) |
Set a custom callback to check if this item should be active.
Definition at line 512 of file grid_view.cc.
References is_active_fn_.
| void blender::ui::PreviewGridItem::set_on_activate_fn | ( | ActivateFn | fn | ) |
Set a custom callback to execute when activating this view item. This way users don't have to sub-class PreviewGridItem, just to implement custom activation behavior (a common thing to do).
Definition at line 507 of file grid_view.cc.
References activate_fn_.
|
protected |
Definition at line 201 of file UI_grid_view.hh.
Referenced by set_on_activate_fn().
|
protected |
Definition at line 204 of file UI_grid_view.hh.
Referenced by build_grid_tile_button(), and hide_label().
|
protected |
Definition at line 203 of file UI_grid_view.hh.
Referenced by set_is_active_fn().
| std::string blender::ui::PreviewGridItem::label |
Definition at line 207 of file UI_grid_view.hh.
Referenced by blender::ed::asset::shelf::AssetViewItem::AssetViewItem(), build_grid_tile_button(), and PreviewGridItem().
| int blender::ui::PreviewGridItem::preview_icon_id = ICON_NONE |
Definition at line 208 of file UI_grid_view.hh.
Referenced by build_grid_tile_button(), and PreviewGridItem().