Commit: 8da9fd000b36cefa90bc8de4c6120a8254ba03e5
Author: Nathan Craddock
Date: Sat Aug 15 20:05:05 2020 -0600
Branches: soc-2020-outliner
https://developer.blender.org/rB8da9fd000b36cefa90bc8de4c6120a8254ba03e5
Outliner: Refactor context menu selection
Use the outliner_item_select function for consistency. Also ensure the
target item is activated so the active can be used in the context menu
operators to identify the type of item to operate on.
===================================================================
M source/blender/editors/space_outliner/outliner_tools.c
===================================================================
diff --git a/source/blender/editors/space_outliner/outliner_tools.c
b/source/blender/editors/space_outliner/outliner_tools.c
index f359bd92688..4fc2e038f57 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -2613,20 +2613,22 @@ static int do_outliner_operation_event(bContext *C,
int scenelevel = 0, objectlevel = 0, idlevel = 0, datalevel = 0;
TreeStoreElem *tselem = TREESTORE(te);
- /* select object that's clicked on and popup context menu */
- if (!(tselem->flag & TSE_SELECTED)) {
+ short select_flag = OL_ITEM_SELECT | OL_ITEM_ACTIVATE;
- if (outliner_flag_is_any_test(&space_outliner->tree, TSE_SELECTED, 1)) {
- outliner_flag_set(&space_outliner->tree, TSE_SELECTED, 0);
- }
+ if (tselem->flag & TSE_SELECTED) {
+ select_flag |= OL_ITEM_EXTEND;
+ }
- tselem->flag |= TSE_SELECTED;
+ outliner_item_select(C, space_outliner, te, select_flag);
- /* Only redraw, don't rebuild here because TreeElement pointers will
- * become invalid and operations will crash. */
- ED_region_tag_redraw_no_rebuild(region);
- ED_outliner_select_sync_from_outliner(C, space_outliner);
- }
+ /* Only redraw, don't rebuild here because TreeElement pointers will
+ * become invalid and operations will crash. */
+ ED_region_tag_redraw_no_rebuild(region);
+ ED_outliner_select_sync_from_outliner(C, space_outliner);
+ /* Only redraw, don't rebuild here because TreeElement pointers will
+ * become invalid and operations will crash. */
+ ED_region_tag_redraw_no_rebuild(region);
+ ED_outliner_select_sync_from_outliner(C, space_outliner);
get_element_operation_type(te, &scenelevel, &objectlevel, &idlevel,
&datalevel);
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs