UI: Show material link type icon in dropdown
Enums that are displayed as icon-only should have their icons defined in RNA, not just through the layout in Python. That way they are shown in the dropdown itself and users make the connection between the listed item label and the icon while collapsed.
This commit is contained in:
@@ -130,8 +130,7 @@ class EEVEE_MATERIAL_PT_context_material(MaterialButtonsPanel, Panel):
|
||||
row.template_ID(ob, "active_material", new="material.new")
|
||||
|
||||
if slot:
|
||||
icon_link = 'MESH_DATA' if slot.link == 'DATA' else 'OBJECT_DATA'
|
||||
row.prop(slot, "link", icon=icon_link, icon_only=True)
|
||||
row.prop(slot, "link", icon_only=True)
|
||||
|
||||
if ob.mode == 'EDIT':
|
||||
row = layout.row(align=True)
|
||||
|
||||
@@ -2337,8 +2337,8 @@ static void rna_def_material_slot(BlenderRNA *brna)
|
||||
PropertyRNA *prop;
|
||||
|
||||
static const EnumPropertyItem link_items[] = {
|
||||
{1, "OBJECT", 0, "Object", ""},
|
||||
{0, "DATA", 0, "Data", ""},
|
||||
{1, "OBJECT", ICON_OBJECT_DATAMODE, "Object", ""},
|
||||
{0, "DATA", ICON_MESH_DATA, "Data", ""},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user