diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-11-01 20:30:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-11-01 21:01:10 +0300 |
commit | 3ec4d0b51bf3a76725e39a57b0f30bec3edc6882 (patch) | |
tree | 8d99f8552e0cc465a9469f5d569433cbfa3dab88 /source/blender/editors/interface/interface.c | |
parent | 07dbff7dc1d5cfca9fbfb74204a2298e16d471b4 (diff) |
UI: Add UILayout.operator_menu_hold
This is an operator button that opens a menu when the button is held.
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r-- | source/blender/editors/interface/interface.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index dc4c1b71066..bc2397d8e47 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -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; |