diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2019-06-14 19:55:07 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2019-06-14 19:55:07 +0300 |
commit | 34644f520a467d39854d95ecd7af6d41c3a4745e (patch) | |
tree | efe7e5db57fa6c7b471e16c30fb79596f9c58bd4 /source/blender/editors/space_outliner | |
parent | e76b223ea3e110485146d299714504ef84adf634 (diff) |
UI: Outliner - GP Icon Changes
Changes all GP layer icons to Pencil and highlights selected layer with background color.
Differential Revision: https://developer.blender.org/D5073
Reviewed by Dalai Felinto
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 40632eee364..4485475d658 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -2151,17 +2151,8 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te) data.icon = ICON_GROUP; break; } - /* Removed the icons from outliner. - * Need a better structure with Layers, Palettes and Colors. */ case TSE_GP_LAYER: { - /* indicate whether layer is active */ - bGPDlayer *gpl = te->directdata; - if (gpl->flag & GP_LAYER_ACTIVE) { - data.icon = ICON_GREASEPENCIL; - } - else { - data.icon = ICON_DOT; - } + data.icon = ICON_GREASEPENCIL; break; } default: @@ -2641,12 +2632,16 @@ static void outliner_draw_iconrow(bContext *C, active = tree_element_active(C, scene, view_layer, soops, te, OL_SETSEL_NONE, false); } } + else if (tselem->type == TSE_GP_LAYER) { + bGPDlayer *gpl = te->directdata; + active = (gpl->flag & GP_LAYER_ACTIVE) ? OL_DRAWSEL_ACTIVE : OL_DRAWSEL_NONE; + } else { active = tree_element_type_active( C, scene, view_layer, soops, te, tselem, OL_SETSEL_NONE, false); } - if (!ELEM(tselem->type, 0, TSE_LAYER_COLLECTION, TSE_R_LAYER)) { + if (!ELEM(tselem->type, 0, TSE_LAYER_COLLECTION, TSE_R_LAYER, TSE_GP_LAYER)) { outliner_draw_iconrow_doit(block, te, fstyle, xmax, offsx, ys, alpha_fac, active, 1); } else { @@ -2808,12 +2803,20 @@ static void outliner_draw_tree_element(bContext *C, } } } - else { - active = tree_element_type_active( - C, scene, view_layer, soops, te, tselem, OL_SETSEL_NONE, false); - /* active collection*/ - icon_bgcolor[3] = 0.2f; + else if (tselem->type == TSE_GP_LAYER) { + /* Active grease pencil layer. */ + if (((bGPDlayer *)te->directdata)->flag & GP_LAYER_ACTIVE) { + icon_bgcolor[3] = 0.2f; + active = OL_DRAWSEL_ACTIVE; + } } + else + { + active = tree_element_type_active( + C, scene, view_layer, soops, te, tselem, OL_SETSEL_NONE, false); + /* active collection*/ + icon_bgcolor[3] = 0.2f; + } /* Checkbox to enable collections. */ if ((tselem->type == TSE_LAYER_COLLECTION) && |