diff --git a/source/blender/editors/include/UI_interface_layout.hh b/source/blender/editors/include/UI_interface_layout.hh index 1630db9cd4e..273720847e1 100644 --- a/source/blender/editors/include/UI_interface_layout.hh +++ b/source/blender/editors/include/UI_interface_layout.hh @@ -659,8 +659,7 @@ struct uiLayout : uiItem, blender::NonCopyable, blender::NonMovable { const char *menu_type); /** Simple button executing \a func on click. */ - uiBut *button(uiLayout *layout, - blender::StringRef name, + uiBut *button(blender::StringRef name, int icon, std::function func, std::optional tooltip = std::nullopt); diff --git a/source/blender/editors/interface/interface_layout.cc b/source/blender/editors/interface/interface_layout.cc index 836a0c239d7..84995d8d693 100644 --- a/source/blender/editors/interface/interface_layout.cc +++ b/source/blender/editors/interface/interface_layout.cc @@ -3091,13 +3091,12 @@ void uiItemLDrag(uiLayout *layout, PointerRNA *ptr, StringRef name, int icon) } } -uiBut *uiLayout::button(uiLayout *layout, - const StringRef name, +uiBut *uiLayout::button(const StringRef name, const int icon, std::function func, std::optional tooltip) { - uiBut *but = uiItem_simple(layout, name, icon, tooltip, UI_BTYPE_BUT); + uiBut *but = uiItem_simple(this, name, icon, tooltip, UI_BTYPE_BUT); UI_but_func_set(but, std::move(func)); return but; }