mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 14:31:39 +00:00
Solving interface issues from #2568
1) Added type manager to N-panel. Actually made side-panel and header layout logic more similar. 2) Added interface from sidebar to properties too
This commit is contained in:
@@ -85,8 +85,9 @@ class BimToolUI:
|
|||||||
|
|
||||||
if context.region.type == "TOOL_HEADER":
|
if context.region.type == "TOOL_HEADER":
|
||||||
cls.draw_header_interface()
|
cls.draw_header_interface()
|
||||||
elif context.region.type == "UI":
|
elif context.region.type in ("UI", "WINDOW"):
|
||||||
cls.draw_sidebar_interface()
|
# same interface for both n-panel sidebar and object properties
|
||||||
|
cls.draw_basic_bim_tool_interface()
|
||||||
|
|
||||||
if context.active_object and context.selected_objects:
|
if context.active_object and context.selected_objects:
|
||||||
cls.draw_edit_object_interface(context)
|
cls.draw_edit_object_interface(context)
|
||||||
@@ -296,19 +297,7 @@ class BimToolUI:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def draw_header_interface(cls):
|
def draw_header_interface(cls):
|
||||||
row = cls.layout.row(align=True)
|
cls.draw_type_selection_interface()
|
||||||
if AuthoringData.data["ifc_classes"]:
|
|
||||||
row.label(text="", icon="FILE_VOLUME")
|
|
||||||
row.prop(data=cls.props, property="ifc_class", text="")
|
|
||||||
row = cls.layout.row(align=True)
|
|
||||||
if AuthoringData.data["relating_types_ids"]:
|
|
||||||
row.label(text="", icon="FILE_3D")
|
|
||||||
prop_with_search(row, cls.props, "relating_type_id", text="")
|
|
||||||
else:
|
|
||||||
row.label(text="No Construction Type", icon="FILE_3D")
|
|
||||||
row.operator("bim.launch_type_manager", icon="LIGHTPROBE_GRID", text="")
|
|
||||||
else:
|
|
||||||
row.operator("bim.launch_type_manager", icon="LIGHTPROBE_GRID")
|
|
||||||
|
|
||||||
if AuthoringData.data["ifc_classes"]:
|
if AuthoringData.data["ifc_classes"]:
|
||||||
#row = cls.layout.row()
|
#row = cls.layout.row()
|
||||||
@@ -324,19 +313,26 @@ class BimToolUI:
|
|||||||
op.relating_type_id = int(cls.props.relating_type_id)
|
op.relating_type_id = int(cls.props.relating_type_id)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def draw_sidebar_interface(cls):
|
def draw_type_selection_interface(cls):
|
||||||
|
# shared by both sidebar and header
|
||||||
row = cls.layout.row(align=True)
|
row = cls.layout.row(align=True)
|
||||||
if AuthoringData.data["ifc_classes"]:
|
if AuthoringData.data["ifc_classes"]:
|
||||||
row.label(text="", icon="FILE_VOLUME")
|
row.label(text="", icon="FILE_VOLUME")
|
||||||
prop_with_search(row, cls.props, "ifc_class", text="")
|
prop_with_search(row, cls.props, "ifc_class", text="")
|
||||||
|
|
||||||
|
row = cls.layout.row(align=True)
|
||||||
|
if AuthoringData.data["relating_types_ids"]:
|
||||||
|
row.label(text="", icon="FILE_3D")
|
||||||
|
prop_with_search(row, cls.props, "relating_type_id", text="")
|
||||||
|
else:
|
||||||
|
row.label(text="No Construction Type", icon="FILE_3D")
|
||||||
else:
|
else:
|
||||||
row.label(text="No Construction Class", icon="FILE_VOLUME")
|
row.label(text="No Construction Class", icon="FILE_VOLUME")
|
||||||
row = cls.layout.row(align=True)
|
row.operator("bim.launch_type_manager", icon="LIGHTPROBE_GRID", text='')
|
||||||
if AuthoringData.data["relating_types_ids"]:
|
|
||||||
row.label(text="", icon="FILE_3D")
|
@classmethod
|
||||||
prop_with_search(row, cls.props, "relating_type_id", text="")
|
def draw_basic_bim_tool_interface(cls):
|
||||||
else:
|
cls.draw_type_selection_interface()
|
||||||
row.label(text="No Construction Type", icon="FILE_3D")
|
|
||||||
|
|
||||||
box = cls.layout.box()
|
box = cls.layout.box()
|
||||||
if AuthoringData.data["type_thumbnail"]:
|
if AuthoringData.data["type_thumbnail"]:
|
||||||
|
|||||||
Reference in New Issue
Block a user