Commit: 34370d9fdf33d6d5c8678a0ad9cf339fcdda00fc Author: Peter Fog Date: Tue Nov 23 05:16:49 2021 +0100 Branches: master https://developer.blender.org/rB34370d9fdf33d6d5c8678a0ad9cf339fcdda00fc
VSE: Add drag and drop handler for preview area For some users, dropping assets into preview area may be more practical due to space constraints or it may be just more intuitive. Reviewed By: ISS Differential Revision: https://developer.blender.org/D13311 =================================================================== M source/blender/editors/space_sequencer/space_sequencer.c =================================================================== diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 9e14aed96d7..f6f8e45590f 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -486,10 +486,9 @@ static void sequencer_drop_copy(wmDrag *drag, wmDropBox *drop) } /* This region dropbox definition. */ -static void sequencer_dropboxes(void) -{ - ListBase *lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW); +static void sequencer_dropboxes_add_to_lb(ListBase *lb) +{ WM_dropbox_add( lb, "SEQUENCER_OT_image_strip_add", image_drop_poll, sequencer_drop_copy, NULL, NULL); WM_dropbox_add( @@ -498,6 +497,14 @@ static void sequencer_dropboxes(void) lb, "SEQUENCER_OT_sound_strip_add", sound_drop_poll, sequencer_drop_copy, NULL, NULL); } +static void sequencer_dropboxes(void) +{ + ListBase *lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW); + sequencer_dropboxes_add_to_lb(lb); + lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_PREVIEW); + sequencer_dropboxes_add_to_lb(lb); +} + /* ************* end drop *********** */ /* DO NOT make this static, this hides the symbol and breaks API generation script. */ @@ -786,6 +793,9 @@ static void sequencer_preview_region_init(wmWindowManager *wm, ARegion *region) /* Own keymap. */ keymap = WM_keymap_ensure(wm->defaultconf, "SequencerPreview", SPACE_SEQ, 0); WM_event_add_keymap_handler_v2d_mask(®ion->handlers, keymap); + + ListBase *lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_PREVIEW); + WM_event_add_dropbox_handler(®ion->handlers, lb); } static void sequencer_preview_region_layout(const bContext *C, ARegion *region) _______________________________________________ Bf-blender-cvs mailing list [email protected] List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
