diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-07-08 09:23:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-07-13 13:03:40 +0300 |
commit | 8839b4c32a44ba2c50f08ccd815d450ac71c454a (patch) | |
tree | b53e08ed505c9e58430579a1fb2a6ba43db71e3a /source/blender/editors/interface/interface_intern.h | |
parent | 1b4d5c7a35597a70411515f721a405416244b540 (diff) |
UI: support persistent state during number/slider interaction
Support for begin/update/end callbacks allowing state to be cached
and reused while dragging a number button or slider.
This is done using `UI_block_interaction_set` to set callbacks.
- Dragging multiple buttons at once is supported,
passing multiple unique events into the update function.
- Update is only called once even when multiple buttons are edited.
- The update callback can detect the difference between click & drag
actions so situations to support skipping cache creation and
freeing for situations where it's not beneficial.
Reviewed by: Severin, HooglyBoogly
Ref D11861
Diffstat (limited to 'source/blender/editors/interface/interface_intern.h')
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index a05afb6e542..40a9c67c630 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -511,6 +511,9 @@ struct uiBlock { uiBlockHandleFunc handle_func; void *handle_func_arg; + /** Custom interaction data. */ + uiBlockInteraction_CallbackData custom_interaction_callbacks; + /** Custom extra event handling. */ int (*block_event_func)(const struct bContext *C, struct uiBlock *, const struct wmEvent *); |