diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-21 16:54:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-21 16:55:24 +0300 |
commit | e4694c057bcc5200e8bd1e906dc1d687a4f3aca2 (patch) | |
tree | ba38075c20a00f6fff32570eca6948e4b5924afc /source/blender/windowmanager | |
parent | 2b21e7ab9a14cfa1d9e42b97d8056c3b0050fcc9 (diff) |
UI: replace button open event with activate on init
No user visible change.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 979473cf761..3db5ff4d848 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1587,8 +1587,6 @@ static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *userdata) { const struct SearchPopupInit_Data *init_data = userdata; static char search[256] = ""; - wmEvent event; - wmWindow *win = CTX_wm_window(C); uiBlock *block; uiBut *but; @@ -1598,6 +1596,7 @@ static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *userdata) but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 10, init_data->size[0], UI_UNIT_Y, 0, 0, ""); UI_but_func_operator_search(but); + UI_but_flag_enable(but, UI_BUT_ACTIVATE_ON_INIT); /* fake button, it holds space for search items */ uiDefBut(block, UI_BTYPE_LABEL, 0, "", 10, 10 - init_data->size[1], @@ -1606,13 +1605,6 @@ static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *userdata) /* Move it downwards, mouse over button. */ UI_block_bounds_set_popup(block, 6, (const int[2]){0, -UI_UNIT_Y}); - wm_event_init_from_window(win, &event); - event.type = EVT_BUT_OPEN; - event.val = KM_PRESS; - event.customdata = but; - event.customdatafree = false; - wm_event_add(win, &event); - return block; } |