Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-03-24 03:34:18 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-03-24 05:41:18 +0300
commitc46dcdf8871e7404516a234087cfc4bf4e2794d0 (patch)
treeca5f6d549a3294441a452ae04507e46360324bad /source/blender/editors/include
parent94b8166a8b0519aef76e8cb8d0c9a6035fe04baf (diff)
UI: add menu search functionality to operator search menu
This has some advantages over operator search: - Some operators need options set to be usefully accessed. - Shows key bindings to access menus (for actions that don't have key bindings themselves). - Non operator actions such as check-boxes are also shown. - Menu items can control execution context, using invoke or execute where appropriate so we can control how the operator runs. Part of the design task T74157. This can be tested using the 'Experimental' preferences section or selected in the key-map editor.
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r--source/blender/editors/include/UI_interface.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 3e416cd8057..bb2edef8adc 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -506,6 +506,9 @@ typedef void (*uiButSearchFunc)(const struct bContext *C,
void *arg,
const char *str,
uiSearchItems *items);
+
+typedef void (*uiButSearchArgFreeFunc)(void *arg);
+
/* Must return allocated string. */
typedef char *(*uiButToolTipFunc)(struct bContext *C, void *argN, const char *tip);
typedef int (*uiButPushedStateFunc)(struct bContext *C, void *arg);
@@ -1565,13 +1568,13 @@ eAutoPropButsReturn uiDefAutoButsRNA(uiLayout *layout,
const bool compact);
/* use inside searchfunc to add items */
-bool UI_search_item_add(uiSearchItems *items, const char *name, void *poin, int iconid);
+bool UI_search_item_add(uiSearchItems *items, const char *name, void *poin, int iconid, int state);
/* bfunc gets search item *poin as arg2, or if NULL the old string */
void UI_but_func_search_set(uiBut *but,
uiButSearchCreateFunc cfunc,
uiButSearchFunc sfunc,
void *arg,
- bool free_arg,
+ uiButSearchArgFreeFunc search_arg_free_func,
uiButHandleFunc bfunc,
void *active);
/* height in pixels, it's using hardcoded values still */
@@ -2035,6 +2038,10 @@ void uiTemplateImageInfo(uiLayout *layout,
void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C);
void UI_but_func_operator_search(uiBut *but);
void uiTemplateOperatorSearch(uiLayout *layout);
+
+void UI_but_func_menu_search(uiBut *but);
+void uiTemplateMenuSearch(uiLayout *layout);
+
eAutoPropButsReturn uiTemplateOperatorPropertyButs(const struct bContext *C,
uiLayout *layout,
struct wmOperator *op,