|
Blender
V3.3
|
#include <UI_grid_view.hh>
Public Types | |
| using | IsActiveFn = std::function< bool()> |
| using | ActivateFn = std::function< void(PreviewGridItem &new_active)> |
Public Attributes | |
| std::string | label {} |
| int | preview_icon_id = ICON_NONE |
Protected Attributes | |
| ActivateFn | activate_fn_ |
| IsActiveFn | is_active_fn_ |
Protected Attributes inherited from blender::ui::AbstractGridViewItem | |
| StringRef | identifier_ {} |
| uiButViewItem * | view_item_but_ = nullptr |
Protected Attributes inherited from blender::ui::AbstractViewItem | |
| AbstractView * | view_ = nullptr |
| bool | is_active_ = false |
| bool | is_renaming_ = false |
Additional Inherited Members | |
Static Public Member Functions inherited from blender::ui::AbstractViewItem | |
| template<typename ToType = AbstractViewItem> | |
| static ToType * | from_item_handle (uiViewItemHandle *handle) |
Protected Member Functions inherited from blender::ui::AbstractGridViewItem | |
| AbstractGridViewItem (StringRef identifier) | |
| virtual bool | matches (const AbstractViewItem &other) const override |
| void | activate () |
| void | deactivate () |
Protected Member Functions inherited from blender::ui::AbstractViewItem | |
| AbstractViewItem ()=default | |
| virtual void | update_from_old (const AbstractViewItem &old) |
| void | add_rename_button (uiBlock &block) |
A grid item that shows preview image icons at a nicely readable size (multiple of the normal UI unit size).
Definition at line 182 of file UI_grid_view.hh.
| using blender::ui::PreviewGridItem::ActivateFn = std::function<void(PreviewGridItem &new_active)> |
Definition at line 185 of file UI_grid_view.hh.
| using blender::ui::PreviewGridItem::IsActiveFn = std::function<bool()> |
Definition at line 184 of file UI_grid_view.hh.
| blender::ui::PreviewGridItem::PreviewGridItem | ( | StringRef | identifier, |
| StringRef | label, | ||
| int | preview_icon_id | ||
| ) |
Definition at line 408 of file grid_view.cc.
Implements blender::ui::AbstractGridViewItem.
Definition at line 413 of file grid_view.cc.
References blender::ui::AbstractGridView::get_style(), blender::ui::AbstractGridViewItem::get_view(), label, preview_icon_id, blender::ui::GridViewStyle::tile_height, blender::ui::GridViewStyle::tile_width, UI_BTYPE_PREVIEW_TILE, UI_BUT_ICON_PREVIEW, ui_def_but_icon(), UI_HAS_ICON, uiDefBut(), and uiLayoutGetBlock().
| 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 443 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 438 of file grid_view.cc.
References activate_fn_.
|
protected |
Definition at line 189 of file UI_grid_view.hh.
Referenced by set_on_activate_fn().
|
protected |
Definition at line 191 of file UI_grid_view.hh.
Referenced by set_is_active_fn().
| std::string blender::ui::PreviewGridItem::label {} |
Definition at line 194 of file UI_grid_view.hh.
Referenced by build_grid_tile().
| int blender::ui::PreviewGridItem::preview_icon_id = ICON_NONE |
Definition at line 195 of file UI_grid_view.hh.
Referenced by build_grid_tile().