mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 10:33:20 +00:00
Fix #5333 : Searching for the class name using the looking glass button doesn't close the type manager anymore.
This commit is contained in:
@@ -199,7 +199,7 @@ def export_attributes(props, callback: Optional[Callable] = None) -> dict[str, A
|
||||
return attributes
|
||||
|
||||
|
||||
def prop_with_search(layout, data, prop_name, **kwargs):
|
||||
def prop_with_search(layout, data, prop_name, should_click_ok_to_validate=False, **kwargs):
|
||||
# kwargs are layout.prop arguments (text, icon, etc.)
|
||||
row = layout.row(align=True)
|
||||
row.prop(data, prop_name, **kwargs)
|
||||
@@ -209,6 +209,7 @@ def prop_with_search(layout, data, prop_name, **kwargs):
|
||||
row.context_pointer_set(name="data", data=data)
|
||||
op = row.operator("bim.enum_property_search", text="", icon="VIEWZOOM")
|
||||
op.prop_name = prop_name
|
||||
op.should_click_ok_to_validate = should_click_ok_to_validate
|
||||
except TypeError: # Prop is not iterable
|
||||
pass
|
||||
|
||||
|
||||
@@ -868,7 +868,8 @@ def update_enum_property_search_prop(self, context):
|
||||
if self.first_launch:
|
||||
self.first_launch = False
|
||||
else:
|
||||
context.window.screen = context.window.screen
|
||||
if not self.should_click_ok_to_validate:
|
||||
context.window.screen = context.window.screen
|
||||
if predefined_type:
|
||||
try:
|
||||
setattr(context.data, "ifc_predefined_type", predefined_type)
|
||||
@@ -888,6 +889,7 @@ class BIM_OT_enum_property_search(bpy.types.Operator):
|
||||
collection_identifiers: bpy.props.CollectionProperty(type=StrProperty)
|
||||
collection_predefined_types: bpy.props.CollectionProperty(type=StrProperty)
|
||||
prop_name: bpy.props.StringProperty()
|
||||
should_click_ok_to_validate: bpy.props.BoolProperty(default=False)
|
||||
|
||||
def invoke(self, context, event):
|
||||
self.clear_collections()
|
||||
|
||||
Reference in New Issue
Block a user