Keying Set UI - Icons for Paths in List

The Keying Set paths list now shows the icon of the type of ID-block
that a path item refers to. This make it easier to make snese of the
paths shown in the list.
This commit is contained in:
2011-07-01 03:35:59 +00:00
parent 77dbc5c914
commit 3eec91f4d7

View File

@@ -33,6 +33,7 @@
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
@@ -55,6 +56,7 @@
#include "ED_render.h"
#include "RNA_access.h"
#include "RNA_enum_types.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -2106,6 +2108,15 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
//uiItemR(row, itemptr, "mute", 0, "", ICON_MUTE_IPO_OFF);
uiBlockSetEmboss(block, UI_EMBOSS);
}
else if(itemptr->type == &RNA_KeyingSetPath) {
KS_Path *ksp = (KS_Path*)itemptr->data;
/* icon needs to be the type of ID which is currently active */
RNA_enum_icon_from_value(id_type_items, ksp->idtype, &icon);
/* nothing else special to do... */
uiItemL(sub, name, icon); /* fails, backdrop LISTROW... */
}
else
uiItemL(sub, name, icon); /* fails, backdrop LISTROW... */