Outliner: in Blender File, use upper case names and icons.

This commit is contained in:
Brecht Van Lommel 2018-05-17 12:20:40 +02:00
parent 1f3143fcc7
commit 6d706dc8c7
2 changed files with 16 additions and 4 deletions

View File

@ -1223,6 +1223,11 @@ static void tselem_draw_icon(uiBlock *block, int xmax, float x, float y, TreeSto
}
break;
}
case ID_BR:
tselem_draw_icon_uibut(&arg, ICON_BRUSH_DATA); break;
case ID_SCR:
case ID_WS:
tselem_draw_icon_uibut(&arg, ICON_SPLITSCREEN); break;
default:
break;
}
@ -1294,10 +1299,11 @@ static void outliner_draw_iconrow(
}
/* this tree element always has same amount of branches, so don't draw */
if (tselem->type != TSE_R_LAYER)
if (tselem->type != TSE_R_LAYER) {
outliner_draw_iconrow(
C, block, scene, view_layer, obedit, soops,
&te->subtree, level + 1, xmax, offsx, ys, alpha_fac);
}
}
}
@ -1435,7 +1441,7 @@ static void outliner_draw_tree_element(
/* datatype icon */
if (!(ELEM(tselem->type, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM))) {
if (!(ELEM(tselem->type, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM, TSE_ID_BASE))) {
tselem_draw_icon(block, xmax, (float)startx + offsx, (float)*starty, tselem, te, alpha_fac);
offsx += UI_UNIT_X + 2 * ufac;
}

View File

@ -1256,6 +1256,12 @@ static void outliner_add_seq_dup(SpaceOops *soops, Sequence *seq, TreeElement *t
/* ----------------------------------------------- */
static const char *outliner_idcode_to_plural(short idcode)
{
const char *propname = BKE_idcode_to_name_plural(idcode);
PropertyRNA *prop = RNA_struct_type_find_property(&RNA_BlendData, propname);
return RNA_property_ui_name(prop);
}
static void outliner_add_library_contents(Main *mainvar, SpaceOops *soops, TreeElement *te, Library *lib)
{
@ -1277,7 +1283,7 @@ static void outliner_add_library_contents(Main *mainvar, SpaceOops *soops, TreeE
ten = outliner_add_element(soops, &te->subtree, lbarray[a], NULL, TSE_ID_BASE, 0);
ten->directdata = lbarray[a];
ten->name = BKE_idcode_to_name_plural(GS(id->name));
ten->name = outliner_idcode_to_plural(GS(id->name));
if (ten->name == NULL)
ten->name = "UNKNOWN";
@ -1317,7 +1323,7 @@ static void outliner_add_orphaned_datablocks(Main *mainvar, SpaceOops *soops)
ten = outliner_add_element(soops, &soops->tree, lbarray[a], NULL, TSE_ID_BASE, 0);
ten->directdata = lbarray[a];
ten->name = BKE_idcode_to_name_plural(GS(id->name));
ten->name = outliner_idcode_to_plural(GS(id->name));
if (ten->name == NULL)
ten->name = "UNKNOWN";