mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 13:46:54 +00:00
Margins function for UILayouts
This commit is contained in:
@@ -118,6 +118,17 @@ def prop_with_search(layout, data, prop_name, **kwargs):
|
|||||||
op.prop_name = prop_name
|
op.prop_name = prop_name
|
||||||
|
|
||||||
|
|
||||||
|
def layout_with_margins(layout, margin_left=0.025, margin_right=None):
|
||||||
|
margin_right = margin_left if margin_right is None else margin_right
|
||||||
|
split = layout.split(factor=margin_left, align=True)
|
||||||
|
cols = [split.column() for _ in range(2)]
|
||||||
|
cols[0].label(text="")
|
||||||
|
subsplit = cols[-1].split(factor=(1. - margin_right), align=True)
|
||||||
|
subcol = subsplit.column()
|
||||||
|
subsplit.column().label(text="")
|
||||||
|
return subcol
|
||||||
|
|
||||||
|
|
||||||
def get_enum_items(data, prop_name, context):
|
def get_enum_items(data, prop_name, context):
|
||||||
# Retrieve items from a dynamic EnumProperty, which is otherwise not supported
|
# Retrieve items from a dynamic EnumProperty, which is otherwise not supported
|
||||||
# Or throws an error in the console when the items callback returns an empty list
|
# Or throws an error in the console when the items callback returns an empty list
|
||||||
|
|||||||
Reference in New Issue
Block a user