diff options
author | Jeroen Bakker <jeroen@blender.org> | 2021-08-02 16:09:15 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-08-02 16:13:21 +0300 |
commit | d60a7a87445c140a42b6470ef2c54c411d8e4bf3 (patch) | |
tree | 5c6c61b07c5fe2f03d99d2262967315f9c9e4963 /source/blender/windowmanager/intern/wm_event_system.c | |
parent | 8edb2222ae0c954771a9cddc2d8c02a7a4d68eae (diff) |
WindowManager: Support Dynamic tooltips when dragging.
Originally the operator name was drawn next to the dragging content.
After that there was an option to add custom, static text with the
dragging content. This patch allows dynamic text to be drawn.
The custom text was implemented as out parameter of the poll function
what made the code unclear. This patch introduces a tooltip function
that separates tooltip generation from the poll function.
NOTE: the text should always be returned in its own memory block. This
block will be freed after it is copied in the drag struct.
Reviewed By: Severin
Differential Revision: https://developer.blender.org/D12104
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 5e29a22304c..5cc361fc1bd 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2851,8 +2851,7 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers if (event->custom == EVT_DATA_DRAGDROP) { ListBase *lb = (ListBase *)event->customdata; LISTBASE_FOREACH (wmDrag *, drag, lb) { - const char *tooltip = NULL; - if (drop->poll(C, drag, event, &tooltip)) { + if (drop->poll(C, drag, event)) { /* Optionally copy drag information to operator properties. Don't call it if the * operator fails anyway, it might do more than just set properties (e.g. * typically import an asset). */ |