UI: Add UILayout.operator_menu_hold
This is an operator button that opens a menu when the button is held.
This commit is contained in:
@@ -2672,6 +2672,10 @@ static void ui_but_free(const bContext *C, uiBut *but)
|
||||
MEM_freeN(but->tip_argN);
|
||||
}
|
||||
|
||||
if (but->hold_argN) {
|
||||
MEM_freeN(but->hold_argN);
|
||||
}
|
||||
|
||||
if (but->active) {
|
||||
/* XXX solve later, buttons should be free-able without context ideally,
|
||||
* however they may have open tooltips or popup windows, which need to
|
||||
@@ -4520,6 +4524,12 @@ void UI_but_focus_on_enter_event(wmWindow *win, uiBut *but)
|
||||
wm_event_add(win, &event);
|
||||
}
|
||||
|
||||
void UI_but_func_hold_set(uiBut *but, uiButHandleHoldFunc func, void *argN)
|
||||
{
|
||||
but->hold_func = func;
|
||||
but->hold_argN = argN;
|
||||
}
|
||||
|
||||
void UI_but_string_info_get(bContext *C, uiBut *but, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
Reference in New Issue
Block a user