diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2017-02-28 16:06:04 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-02-28 16:11:15 +0300 |
commit | 6af21b4e7f5d6920cf17d836ed2b51b186e09e77 (patch) | |
tree | 03fa3959fed7ad0dd0d4690f5c27d06c6c91166b | |
parent | 2de9bf1138768bce6bd0698d5185fee97520a600 (diff) |
Highlight active collection in outliner
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_select.c | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index b8a43357482..cc5afd51493 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -1237,7 +1237,7 @@ static void outliner_draw_iconrow(bContext *C, uiBlock *block, Scene *scene, Sce } } else { - active = tree_element_type_active(NULL, scene, sl, soops, te, tselem, OL_SETSEL_NONE, false); + active = tree_element_type_active(C, scene, sl, soops, te, tselem, OL_SETSEL_NONE, false); } if (active != OL_DRAWSEL_NONE) { @@ -1366,9 +1366,7 @@ static void outliner_draw_tree_element( } } else { - if (tree_element_type_active(NULL, scene, sl, soops, te, tselem, OL_SETSEL_NONE, false) != OL_DRAWSEL_NONE) { - active = OL_DRAWSEL_ACTIVE; - } + active = tree_element_type_active(C, scene, sl, soops, te, tselem, OL_SETSEL_NONE, false); rgba_float_args_set(color, 0.85f, 0.85f, 1.0f, alpha); } diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 0793ba50c32..cb4d5e9255b 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -186,7 +186,7 @@ static eOLDrawState tree_element_set_active_object( do_outliner_object_select_recursive(scene, ob, (ob->flag & SELECT) != 0); } - if (C) { + if (set != OL_SETSEL_NONE) { ED_object_base_activate(C, base); /* adds notifier */ WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); } @@ -757,7 +757,12 @@ static eOLDrawState tree_element_active_keymap_item( static eOLDrawState tree_element_active_collection( bContext *C, TreeElement *te, TreeStoreElem *UNUSED(tselem), const eOLSetState set) { - if (set != OL_SETSEL_NONE) { + if (set == OL_SETSEL_NONE) { + if (CTX_data_layer_collection(C) == te->directdata) { + return OL_DRAWSEL_NORMAL; + } + } + else { SceneLayer *sl = CTX_data_scene_layer(C); LayerCollection *lc = te->directdata; const int collection_index = BKE_layer_collection_findindex(sl, lc); @@ -765,7 +770,6 @@ static eOLDrawState tree_element_active_collection( BLI_assert(collection_index >= 0); sl->active_collection = collection_index; WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL); - return OL_DRAWSEL_ACTIVE; } return OL_DRAWSEL_NONE; @@ -803,8 +807,6 @@ eOLDrawState tree_element_active(bContext *C, Scene *scene, SceneLayer *sl, Spac /** * Generic call for non-id data to make/check active in UI - * - * \note Context can be NULL when ``(set == OL_SETSEL_NONE)`` */ eOLDrawState tree_element_type_active( bContext *C, Scene *scene, SceneLayer *sl, SpaceOops *soops, |