Brush Assets: Support adding shortcut to asset shelf items #117861
|
@ -217,7 +217,7 @@ void AssetViewItem::build_grid_tile(uiLayout &layout) const
|
|||
asset::operator_asset_reference_props_set(*handle_get_representation(&asset_), op_props);
|
||||
}
|
||||
|
||||
ui::PreviewGridItem::build_grid_tile_button(layout, ot, op_props);
|
||||
ui::PreviewGridItem::build_grid_tile_button(layout, ot, &op_props);
|
||||
}
|
||||
|
||||
void AssetViewItem::build_context_menu(bContext &C, uiLayout &column) const
|
||||
|
|
|
@ -209,8 +209,8 @@ class PreviewGridItem : public AbstractGridViewItem {
|
|||
* \note: Takes ownership of the operator properies defined in \a op_props.
|
||||
*/
|
||||
void build_grid_tile_button(uiLayout &layout,
|
||||
HooglyBoogly marked this conversation as resolved
|
||||
const wmOperatorType *ot,
|
||||
const PointerRNA &op_props) const;
|
||||
const wmOperatorType *ot = nullptr,
|
||||
const PointerRNA *op_props = nullptr) const;
|
||||
|
||||
/**
|
||||
* Set a custom callback to execute when activating this view item. This way users don't have to
|
||||
|
|
|
@ -413,7 +413,7 @@ PreviewGridItem::PreviewGridItem(StringRef identifier, StringRef label, int prev
|
|||
|
||||
void PreviewGridItem::build_grid_tile_button(uiLayout &layout,
|
||||
const wmOperatorType *ot,
|
||||
const PointerRNA &op_props) const
|
||||
const PointerRNA *op_props) const
|
||||
{
|
||||
const GridViewStyle &style = this->get_view().get_style();
|
||||
uiBlock *block = uiLayoutGetBlock(&layout);
|
||||
|
@ -430,7 +430,7 @@ void PreviewGridItem::build_grid_tile_button(uiLayout &layout,
|
|||
style.tile_width,
|
||||
style.tile_height,
|
||||
"");
|
||||
but->opptr = MEM_new<PointerRNA>(__func__, op_props);
|
||||
but->opptr = MEM_new<PointerRNA>(__func__, *op_props);
|
||||
}
|
||||
else {
|
||||
but = uiDefBut(block,
|
||||
|
@ -465,7 +465,7 @@ void PreviewGridItem::build_grid_tile_button(uiLayout &layout,
|
|||
|
||||
void PreviewGridItem::build_grid_tile(uiLayout &layout) const
|
||||
{
|
||||
this->build_grid_tile_button(layout, nullptr, {});
|
||||
this->build_grid_tile_button(layout);
|
||||
}
|
||||
|
||||
void PreviewGridItem::set_on_activate_fn(ActivateFn fn)
|
||||
|
|
Loading…
Reference in New Issue
Would add default arguments for convenience, but also to simply communicate that these are optional.