[Bf-blender-cvs] [81e795e7f01] master: Fix T84953: Incorrect tooltip for dragging collections

Hans Goudey noreply at git.blender.org
Fri Feb 26 02:23:49 CET 2021


Commit: 81e795e7f011e7746b969c877cfaaeeab100883a
Author: Hans Goudey
Date:   Thu Feb 25 19:23:02 2021 -0600
Branches: master
https://developer.blender.org/rB81e795e7f011e7746b969c877cfaaeeab100883a

Fix T84953: Incorrect tooltip for dragging collections

"Shift to parent" does not make any sense for collections since they
don't have parenting like objects. This commit just adds a simple check
for whether the first drag ID is an object before displaying
that part of the message.

Differential Revision: https://developer.blender.org/D10203

===================================================================

M	source/blender/editors/space_outliner/outliner_dragdrop.c

===================================================================

diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c
index 6df1e449b97..3090cab75ae 100644
--- a/source/blender/editors/space_outliner/outliner_dragdrop.c
+++ b/source/blender/editors/space_outliner/outliner_dragdrop.c
@@ -1213,11 +1213,23 @@ static bool collection_drop_poll(bContext *C,
             *r_tooltip = TIP_("Move after collection");
           }
           break;
-        case TE_INSERT_INTO:
+        case TE_INSERT_INTO: {
           tselem->flag |= TSE_DRAG_INTO;
           changed = true;
-          *r_tooltip = TIP_("Move inside collection (Ctrl to link, Shift to parent)");
+
+          /* Check the type of the drag IDs to avoid the incorrect "Shift to parent"
+           * for collections. Checking the type of the first ID works fine here since
+           * all drag IDs are the same type. */
+          wmDragID *drag_id = (wmDragID *)drag->ids.first;
+          const bool is_object = (GS(drag_id->id->name) == ID_OB);
+          if (is_object) {
+            *r_tooltip = TIP_("Move inside collection (Ctrl to link, Shift to parent)");
+          }
+          else {
+            *r_tooltip = TIP_("Move inside collection (Ctrl to link)");
+          }
           break;
+        }
       }
     }
     if (changed) {



More information about the Bf-blender-cvs mailing list