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:
2017-11-02 04:30:07 +11:00
parent 07dbff7dc1
commit 3ec4d0b51b
8 changed files with 234 additions and 28 deletions

View File

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