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 <julian@blender.org>2021-10-11 17:39:35 +0300
committerJulian Eisel <julian@blender.org>2021-10-11 17:39:52 +0300
commit6fd45a110cfb13015764ae70c7967b0f8f5a4f3b (patch)
tree789c3b24a529e7537ad73975cef6f497b0cd2508
parentb1a319f4e0dea2ff4f108bd8b75f9a55288fed8f (diff)
Only hide preview image while dragging over 3D Viewasset-browser-snap-dragging
Make the preview hide and unhide depending on if the user drags over the 3D View. In there the preview is too much visual noice, together with the bounding box and snapping plane we draw there.
-rw-r--r--source/blender/windowmanager/WM_types.h2
-rw-r--r--source/blender/windowmanager/intern/wm_dragdrop.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 24bf36455dd..b6947e5263a 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -1032,7 +1032,7 @@ typedef struct wmDrag {
float scale;
int sx, sy;
- /** Don't draw the icon or image (`imb`). */
+ /** Don't draw the icon or image (`imb`). Can be set in the `poll()` callback of the drop-box. */
bool no_preview;
/** If filled, draws operator tooltip/operator name. */
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c
index 8c39b403810..9743153035e 100644
--- a/source/blender/windowmanager/intern/wm_dragdrop.c
+++ b/source/blender/windowmanager/intern/wm_dragdrop.c
@@ -392,6 +392,8 @@ static void wm_drop_operator_options(bContext *C, wmDrag *drag, const wmEvent *e
}
drag->tooltip[0] = 0;
+ /* Allow setting this in the `poll()`. */
+ drag->no_preview = false;
/* check buttons (XXX todo rna and value) */
if (UI_but_active_drop_name(C)) {