mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 10:51:13 +00:00
Fixed UI for box alignment
Replaced checkboxes with icons and removed vertical and horizontal space between them, now looks neat.
This commit is contained in:
@@ -1236,19 +1236,20 @@ class EditTextPopup(bpy.types.Operator):
|
|||||||
attributes = [a for a in literal_props.attributes if a.name != "BoxAlignment"]
|
attributes = [a for a in literal_props.attributes if a.name != "BoxAlignment"]
|
||||||
blenderbim.bim.helper.draw_attributes(attributes, box)
|
blenderbim.bim.helper.draw_attributes(attributes, box)
|
||||||
|
|
||||||
# a bit hacky way to align box alignment widget
|
row = box.row(align=True)
|
||||||
rows = [box.row(align=True) for i in range(3)]
|
cols = [row.column(align=True) for i in range(3)]
|
||||||
for i in range(9):
|
for i in range(9):
|
||||||
if i % 3 == 0:
|
cols[i % 3].prop(
|
||||||
split = rows[i // 3].split(factor=0.1, align=True)
|
literal_props,
|
||||||
split.column()
|
"box_alignment",
|
||||||
split.prop(literal_props, "box_alignment", text="", index=i)
|
text="",
|
||||||
|
index=i,
|
||||||
|
icon="RADIOBUT_ON" if literal_props.box_alignment[i] else "RADIOBUT_OFF",
|
||||||
|
)
|
||||||
|
|
||||||
text_lines = ["Text box alignment:", literal_props.attributes["BoxAlignment"].string_value, ""]
|
col = row.column(align=True)
|
||||||
for i in range(3):
|
col.label(text=" Text box alignment:")
|
||||||
split = rows[i].split(factor=0.1, align=False)
|
col.label(text=f' {literal_props.attributes["BoxAlignment"].string_value}')
|
||||||
split.column()
|
|
||||||
split.label(text=text_lines[i])
|
|
||||||
|
|
||||||
def cancel(self, context):
|
def cancel(self, context):
|
||||||
# disable editing when dialog is closed
|
# disable editing when dialog is closed
|
||||||
|
|||||||
@@ -373,19 +373,21 @@ class BIM_PT_text(Panel):
|
|||||||
attributes = [a for a in literal_props.attributes if a.name != "BoxAlignment"]
|
attributes = [a for a in literal_props.attributes if a.name != "BoxAlignment"]
|
||||||
blenderbim.bim.helper.draw_attributes(attributes, box)
|
blenderbim.bim.helper.draw_attributes(attributes, box)
|
||||||
|
|
||||||
# a bit hacky way to align box alignment widget
|
row = box.row(align=True)
|
||||||
rows = [box.row(align=True) for i in range(3)]
|
cols = [row.column(align=True) for i in range(3)]
|
||||||
for i in range(9):
|
for i in range(9):
|
||||||
if i % 3 == 0:
|
cols[i % 3].prop(
|
||||||
split = rows[i // 3].split(factor=0.1, align=True)
|
literal_props,
|
||||||
split.column()
|
"box_alignment",
|
||||||
split.prop(literal_props, "box_alignment", text="", index=i)
|
text="",
|
||||||
|
index=i,
|
||||||
|
icon="RADIOBUT_ON" if literal_props.box_alignment[i] else "RADIOBUT_OFF",
|
||||||
|
)
|
||||||
|
|
||||||
|
col = row.column(align=True)
|
||||||
|
col.label(text=" Text box alignment:")
|
||||||
|
col.label(text=f' {literal_props.attributes["BoxAlignment"].string_value}')
|
||||||
|
|
||||||
text_lines = ["Text box alignment:", literal_props.attributes["BoxAlignment"].string_value, ""]
|
|
||||||
for i in range(3):
|
|
||||||
split = rows[i].split(factor=0.1, align=False)
|
|
||||||
split.column()
|
|
||||||
split.label(text=text_lines[i])
|
|
||||||
else:
|
else:
|
||||||
text_data = DecoratorData.get_ifc_text_data(obj)
|
text_data = DecoratorData.get_ifc_text_data(obj)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user