|
Blender V4.3
|
#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 | |
| StringRef | 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_renaming_ = false |
| bool | is_highlighted_search_ = false |
| bool | is_filtered_visible_ = true |
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 () |
| virtual bool | set_state_active () |
| 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 192 of file UI_grid_view.hh.
| using blender::ui::PreviewGridItem::ActivateFn = std::function<void(bContext &C, PreviewGridItem &new_active)> |
Definition at line 195 of file UI_grid_view.hh.
| using blender::ui::PreviewGridItem::IsActiveFn = std::function<bool()> |
Definition at line 194 of file UI_grid_view.hh.
| blender::ui::PreviewGridItem::PreviewGridItem | ( | StringRef | identifier, |
| StringRef | label, | ||
| int | preview_icon_id ) |
Definition at line 475 of file grid_view.cc.
|
overridevirtual |
Implements blender::ui::AbstractGridViewItem.
Definition at line 516 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 480 of file grid_view.cc.
References BKE_icon_is_image(), BKE_icon_is_preview(), blender::ui::AbstractGridView::get_style(), blender::ui::AbstractGridViewItem::get_view(), hide_label_, label, preview_icon_id, blender::ui::GridViewStyle::tile_height, blender::ui::GridViewStyle::tile_width, UI_BTYPE_PREVIEW_TILE, UI_but_func_tooltip_label_set(), UI_BUT_ICON_PREVIEW, ui_def_but_icon(), UI_EMBOSS_NONE, UI_HAS_ICON, uiDefBut(), uiLayoutGetBlock(), 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 531 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 526 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 521 of file grid_view.cc.
References activate_fn_.
|
protected |
Definition at line 199 of file UI_grid_view.hh.
Referenced by set_on_activate_fn().
|
protected |
Definition at line 202 of file UI_grid_view.hh.
Referenced by build_grid_tile_button(), and hide_label().
|
protected |
Definition at line 201 of file UI_grid_view.hh.
Referenced by set_is_active_fn().
| std::string blender::ui::PreviewGridItem::label |
Definition at line 205 of file UI_grid_view.hh.
Referenced by build_grid_tile_button().
| int blender::ui::PreviewGridItem::preview_icon_id = ICON_NONE |
Definition at line 206 of file UI_grid_view.hh.
Referenced by build_grid_tile_button().