From 1d78720e741b6ab18bbec1fefcc1bd28d42c02da Mon Sep 17 00:00:00 2001 From: Nathan Craddock Date: Thu, 20 Aug 2020 11:28:24 -0600 Subject: Outliner: Parent highlight for collapsed active child Draw the row highlighted for the parents of a subtree with the active object when that subtree is collapsed. --- source/blender/editors/space_outliner/outliner_draw.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index cf6a86ba6d7..084bc637413 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -3374,6 +3374,7 @@ static void outliner_draw_highlights_recursive(uint pos, LISTBASE_FOREACH (TreeElement *, te, lb) { const TreeStoreElem *tselem = TREESTORE(te); const int start_y = *io_start_y; + const int end_x = (int)region->v2d.cur.xmax; /* selection status */ if ((tselem->flag & TSE_ACTIVE) && (tselem->flag & TSE_SELECTED)) { @@ -3387,7 +3388,6 @@ static void outliner_draw_highlights_recursive(uint pos, /* highlights */ if (tselem->flag & (TSE_DRAG_ANY | TSE_HIGHLIGHTED | TSE_SEARCHMATCH)) { - const int end_x = (int)region->v2d.cur.xmax; if (tselem->flag & TSE_DRAG_ANY) { /* drag and drop highlight */ @@ -3440,6 +3440,11 @@ static void outliner_draw_highlights_recursive(uint pos, start_x + UI_UNIT_X, io_start_y); } + else if (outliner_find_element_with_flag(&te->subtree, TSE_ACTIVE)) { + /* Parent highlight for active element in collapsed subtree. */ + immUniformColor4fv(col_highlight); + immRecti(pos, 0, start_y, end_x, start_y + UI_UNIT_Y); + } } } -- cgit v1.2.3