[Bf-blender-cvs] [bec588da8a0] soc-2020-outliner: Outliner: Prevent box select & dragdrop from mode col

Nathan Craddock noreply at git.blender.org
Sun Aug 16 05:37:11 CEST 2020


Commit: bec588da8a07d974e2d72387d8899600f7addaa3
Author: Nathan Craddock
Date:   Sat Aug 15 21:36:58 2020 -0600
Branches: soc-2020-outliner
https://developer.blender.org/rBbec588da8a07d974e2d72387d8899600f7addaa3

Outliner: Prevent box select & dragdrop from mode col

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

M	source/blender/editors/space_outliner/outliner_dragdrop.c
M	source/blender/editors/space_outliner/outliner_intern.h
M	source/blender/editors/space_outliner/outliner_select.c

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

diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c
index b78b3a8cb78..6eb962dd0a1 100644
--- a/source/blender/editors/space_outliner/outliner_dragdrop.c
+++ b/source/blender/editors/space_outliner/outliner_dragdrop.c
@@ -1355,6 +1355,9 @@ static int outliner_item_drag_drop_invoke(bContext *C,
   if (outliner_item_is_co_within_close_toggle(te, view_mval[0])) {
     return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH);
   }
+  if (outliner_is_co_within_mode_column(space_outliner, view_mval)) {
+    return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH;
+  }
 
   /* Scroll the view when dragging near edges, but not
    * when the drag goes too far outside the region. */
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index 64b06618948..324fc4df295 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -290,6 +290,7 @@ void outliner_object_mode_toggle(struct bContext *C,
 
 bool outliner_item_is_co_over_name_icons(const TreeElement *te, float view_co_x);
 bool outliner_item_is_co_within_close_toggle(const TreeElement *te, float view_co_x);
+bool outliner_is_co_within_mode_column(SpaceOutliner *space_outliner, const float view_mval[2]);
 
 void outliner_item_mode_toggle(struct bContext *C,
                                TreeViewContext *tvc,
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 10af5c5fb64..143c4acb914 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1640,8 +1640,7 @@ static bool outliner_is_co_within_restrict_columns(const SpaceOutliner *space_ou
   return (view_co_x > region->v2d.cur.xmax - outliner_restrict_columns_width(space_outliner));
 }
 
-static bool outliner_is_co_within_mode_column(SpaceOutliner *space_outliner,
-                                              const float view_mval[2])
+bool outliner_is_co_within_mode_column(SpaceOutliner *space_outliner, const float view_mval[2])
 {
   /* Mode toggles only show in View Layer and Scenes modes. */
   if (!ELEM(space_outliner->outlinevis, SO_VIEW_LAYER, SO_SCENES)) {
@@ -1844,6 +1843,10 @@ static int outliner_box_select_invoke(bContext *C, wmOperator *op, const wmEvent
     return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH;
   }
 
+  if (outliner_is_co_within_mode_column(space_outliner, view_mval)) {
+    return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH;
+  }
+
   return WM_gesture_box_invoke(C, op, event);
 }



More information about the Bf-blender-cvs mailing list