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
path: root/source
diff options
context:
space:
mode:
authorNathan Craddock <nzcraddock@gmail.com>2019-08-18 02:06:02 +0300
committerNathan Craddock <nzcraddock@gmail.com>2019-08-20 01:49:43 +0300
commit4421eb684d08888f070622e300c791ae1c54f989 (patch)
tree6b4738e99501277bef83764e7104ce729c549ab9 /source
parent74d05eb71a0d2a617749898657cb8e617b353204 (diff)
Outliner: Add range extend select
Add support for ctrl+shift+lmb to default and industry compatible keymaps to select a range without removing the existing selection.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 75219e6624f..f5ff730625a 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1269,7 +1269,10 @@ static void do_outliner_range_select_recursive(ListBase *lb,
}
/* Select a range of items between cursor and active element */
-static void do_outliner_range_select(bContext *C, SpaceOutliner *soops, TreeElement *cursor)
+static void do_outliner_range_select(bContext *C,
+ SpaceOutliner *soops,
+ TreeElement *cursor,
+ const bool extend)
{
TreeElement *active = outliner_find_element_with_flag(&soops->tree, TSE_ACTIVE);
outliner_flag_set(&soops->tree, TSE_ACTIVE_WALK, false);
@@ -1283,7 +1286,9 @@ static void do_outliner_range_select(bContext *C, SpaceOutliner *soops, TreeElem
TreeStoreElem *tselem = TREESTORE(active);
const bool active_selected = (tselem->flag & TSE_SELECTED);
- outliner_flag_set(&soops->tree, TSE_SELECTED | TSE_ACTIVE_WALK, false);
+ if (!extend) {
+ outliner_flag_set(&soops->tree, TSE_SELECTED | TSE_ACTIVE_WALK, false);
+ }
/* Select active if under cursor */
if (active == cursor) {
@@ -1298,8 +1303,6 @@ static void do_outliner_range_select(bContext *C, SpaceOutliner *soops, TreeElem
return;
}
- outliner_flag_set(&soops->tree, TSE_SELECTED, false);
-
bool selecting = false;
do_outliner_range_select_recursive(&soops->tree, active, cursor, &selecting);
}
@@ -1380,7 +1383,7 @@ static int outliner_item_do_activate_from_cursor(bContext *C,
TreeStoreElem *activate_tselem = TREESTORE(activate_te);
if (use_range) {
- do_outliner_range_select(C, soops, activate_te);
+ do_outliner_range_select(C, soops, activate_te, extend);
}
else {
outliner_item_select(soops, activate_te, extend, extend);