Fix drawing of bool properties in UI (#1689)
This commit is contained in:
parent
84663bc981
commit
98481929df
|
@ -18,11 +18,11 @@ class ArmPropertyListItem(bpy.types.PropertyGroup):
|
||||||
|
|
||||||
class ARM_UL_PropertyList(bpy.types.UIList):
|
class ARM_UL_PropertyList(bpy.types.UIList):
|
||||||
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
|
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
|
||||||
|
layout.use_property_split = False
|
||||||
# Make sure your code supports all 3 layout types
|
# Make sure your code supports all 3 layout types
|
||||||
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
||||||
row = layout.row()
|
layout.prop(item, "name_prop", text="", emboss=False, icon="OBJECT_DATAMODE")
|
||||||
row.prop(item, "name_prop", text="", emboss=False, icon="OBJECT_DATAMODE")
|
layout.prop(item, item.type_prop + "_prop", text="", emboss=(item.type_prop == 'boolean'))
|
||||||
row.prop(item, item.type_prop + "_prop", text="", emboss=(item.type_prop == 'boolean'))
|
|
||||||
elif self.layout_type in {'GRID'}:
|
elif self.layout_type in {'GRID'}:
|
||||||
layout.alignment = 'CENTER'
|
layout.alignment = 'CENTER'
|
||||||
layout.label(text="", icon="OBJECT_DATAMODE")
|
layout.label(text="", icon="OBJECT_DATAMODE")
|
||||||
|
@ -155,4 +155,4 @@ def unregister():
|
||||||
bpy.utils.unregister_class(ARM_UL_PropertyList)
|
bpy.utils.unregister_class(ARM_UL_PropertyList)
|
||||||
bpy.utils.unregister_class(ArmPropertyListNewItem)
|
bpy.utils.unregister_class(ArmPropertyListNewItem)
|
||||||
bpy.utils.unregister_class(ArmPropertyListDeleteItem)
|
bpy.utils.unregister_class(ArmPropertyListDeleteItem)
|
||||||
bpy.utils.unregister_class(ArmPropertyListMoveItem)
|
bpy.utils.unregister_class(ArmPropertyListMoveItem)
|
||||||
|
|
Loading…
Reference in a new issue