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/editors/space_sequencer | |
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/editors/space_sequencer')
-rw-r--r-- | source/blender/editors/space_sequencer/space_sequencer.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 6de95f0995a..00f3bf6ac72 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -364,10 +364,7 @@ static void sequencer_listener(const wmSpaceTypeListenerParams *params) /* ************* dropboxes ************* */ -static bool image_drop_poll(bContext *C, - wmDrag *drag, - const wmEvent *event, - const char **UNUSED(r_tooltip)) +static bool image_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) { ARegion *region = CTX_wm_region(C); Scene *scene = CTX_data_scene(C); @@ -384,10 +381,7 @@ static bool image_drop_poll(bContext *C, return 0; } -static bool movie_drop_poll(bContext *C, - wmDrag *drag, - const wmEvent *event, - const char **UNUSED(r_tooltip)) +static bool movie_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) { ARegion *region = CTX_wm_region(C); Scene *scene = CTX_data_scene(C); @@ -403,10 +397,7 @@ static bool movie_drop_poll(bContext *C, return 0; } -static bool sound_drop_poll(bContext *C, - wmDrag *drag, - const wmEvent *event, - const char **UNUSED(r_tooltip)) +static bool sound_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) { ARegion *region = CTX_wm_region(C); Scene *scene = CTX_data_scene(C); @@ -448,9 +439,12 @@ static void sequencer_dropboxes(void) { ListBase *lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW); - WM_dropbox_add(lb, "SEQUENCER_OT_image_strip_add", image_drop_poll, sequencer_drop_copy, NULL); - WM_dropbox_add(lb, "SEQUENCER_OT_movie_strip_add", movie_drop_poll, sequencer_drop_copy, NULL); - WM_dropbox_add(lb, "SEQUENCER_OT_sound_strip_add", sound_drop_poll, sequencer_drop_copy, NULL); + WM_dropbox_add( + lb, "SEQUENCER_OT_image_strip_add", image_drop_poll, sequencer_drop_copy, NULL, NULL); + WM_dropbox_add( + lb, "SEQUENCER_OT_movie_strip_add", movie_drop_poll, sequencer_drop_copy, NULL, NULL); + WM_dropbox_add( + lb, "SEQUENCER_OT_sound_strip_add", sound_drop_poll, sequencer_drop_copy, NULL, NULL); } /* ************* end drop *********** */ |