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:
Julian Eisel
2025-07-16 17:07:33 +02:00
parent 736559f320
commit c2497d16e3
2 changed files with 3 additions and 5 deletions

View File

@@ -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);

View File

@@ -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;
}