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:
authorJulian Eisel <eiseljulian@gmail.com>2017-03-10 19:05:50 +0300
committerJulian Eisel <eiseljulian@gmail.com>2017-03-10 19:17:13 +0300
commit67302025105ed3f1273b5714d792ec7a79f7e381 (patch)
treeff69b8cc5e23a082374d5f7d1521d5783420e71b /source/blender/editors/space_outliner/outliner_intern.h
parent1100ddeaa97c561c277a63c61b3ebee96b5ef877 (diff)
Improve outliner drag&drop feedback by using drop poll callbacks
This way we can ensure the overlay to indicate where the item would be placed if it was dropped now is always at the correct place and doesn't mislead the user.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_intern.h')
-rw-r--r--source/blender/editors/space_outliner/outliner_intern.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index cad34c96db4..2256e55a315 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -70,6 +70,13 @@ typedef enum TreeTraversalAction {
*/
typedef void (*TreeElementReinsertFunc)(const struct Scene *scene, struct TreeElement *insert_element,
struct TreeElement *insert_handle, TreeElementInsertType action);
+/**
+ * Executed on (almost) each mouse move while dragging. It's supposed to give info
+ * if reinserting insert_element before/after/into insert_handle would be allowed.
+ * It's allowed to change the reinsert info here for non const pointers.
+ */
+typedef bool (*TreeElementReinsertPollFunc)(const struct Scene *scene, const struct TreeElement *insert_element,
+ struct TreeElement **io_insert_handle, TreeElementInsertType *io_action);
typedef TreeTraversalAction (*TreeTraversalFunc)(struct TreeElement *te, void *customdata);
@@ -86,8 +93,9 @@ typedef struct TreeElement {
void *directdata; // Armature Bones, Base, Sequence, Strip...
PointerRNA rnaptr; // RNA Pointer
- /* callbacks */
+ /* callbacks - TODO should be moved into a type (like TreeElementType) */
TreeElementReinsertFunc reinsert;
+ TreeElementReinsertPollFunc reinsert_poll;
struct {
TreeElementInsertType insert_type;