Only show type selection buttons when a type is available.

This commit is contained in:
Dion Moult
2021-10-21 14:10:24 +11:00
parent 456adf453d
commit aee7fbcc79
@@ -81,14 +81,13 @@ class BIM_PT_type(Panel):
Data.products[oprops.ifc_definition_id]["type"], Data.products[oprops.ifc_definition_id]["Name"]
)
if name == "None/None":
label = "This object has no type"
row.label(text="This object has no type")
row.operator("bim.enable_editing_type", icon="GREASEPENCIL", text="")
else:
label = name
row.label(text=label)
row.operator("bim.select_type", icon="TRACKER", text="")
row.operator("bim.select_similar_type", icon="RESTRICT_SELECT_OFF", text="")
row.operator("bim.enable_editing_type", icon="GREASEPENCIL", text="")
if name != "None/None":
row.label(text=name)
row.operator("bim.select_type", icon="TRACKER", text="")
row.operator("bim.select_similar_type", icon="RESTRICT_SELECT_OFF", text="")
row.operator("bim.enable_editing_type", icon="GREASEPENCIL", text="")
row.operator("bim.unassign_type", icon="X", text="")