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:
authorPeter Fog <tintwotin>2021-11-23 07:16:49 +0300
committerRichard Antalik <richardantalik@gmail.com>2021-11-23 07:40:08 +0300
commit34370d9fdf33d6d5c8678a0ad9cf339fcdda00fc (patch)
treeb4852c272fd694c1824234c377ca37e0ed65c5a7 /source/blender/editors/space_sequencer/space_sequencer.c
parentb42494cf6b00d0c2c681c7c84fc39f579fe74b97 (diff)
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
Diffstat (limited to 'source/blender/editors/space_sequencer/space_sequencer.c')
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c16
1 files changed, 13 insertions, 3 deletions
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(&region->handlers, keymap);
+
+ ListBase *lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_PREVIEW);
+ WM_event_add_dropbox_handler(&region->handlers, lb);
}
static void sequencer_preview_region_layout(const bContext *C, ARegion *region)