Cleanup: Remove redundant parameter in new UI layout function
Mistake in 2658754324.
This was changed from a free standing to a member function during review. But
forgot to update the parameters accordingly. This can be confusing since you
can call the function on one layout, but pass it another one that it will
actually operate on.
This commit is contained in:
@@ -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<void(bContext &)> func,
|
||||
std::optional<blender::StringRef> tooltip = std::nullopt);
|
||||
|
||||
@@ -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<void(bContext &)> func,
|
||||
std::optional<blender::StringRef> 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user