mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 18:43:26 +00:00
Fix broken scroll bar in some UI lists #6439
Just found that all scroll bars for UIList kept in sync using `list_id` - it's that second argument for `UILayout.template_list` that I forgot exist, since I've never seen set it to anything besides the empty string. So in #6439 we were reusing same UIList for multiple collection props and since one of the props was empty, it was constantly resetting scroll bar position. Was about to report it as a bug to Blender but stumbled upon similar issue https://projects.blender.org/blender/blender/issues/124364 So the solution is make sure each UIList has unique `list_id`. Fyi @Moult @Gorgious56
This commit is contained in:
@@ -178,7 +178,14 @@ class BIM_PT_brickschema_viewport(Panel):
|
||||
|
||||
row = grid_left.row()
|
||||
BIM_UL_bricks.split_screen = False
|
||||
row.template_list("BIM_UL_bricks", "", self.props, "bricks", self.props, "active_brick_index")
|
||||
row.template_list(
|
||||
BIM_UL_bricks.__name__,
|
||||
BIM_UL_bricks.__name__ + "_bricks",
|
||||
self.props,
|
||||
"bricks",
|
||||
self.props,
|
||||
"active_brick_index",
|
||||
)
|
||||
|
||||
if self.props.split_screen_toggled:
|
||||
grid_right = grid.column(align=True)
|
||||
@@ -195,7 +202,12 @@ class BIM_PT_brickschema_viewport(Panel):
|
||||
row = grid_right.row()
|
||||
BIM_UL_bricks.split_screen = True
|
||||
row.template_list(
|
||||
"BIM_UL_bricks", "", self.props, "split_screen_bricks", self.props, "split_screen_active_brick_index"
|
||||
BIM_UL_bricks.__name__,
|
||||
BIM_UL_bricks.__name__ + "_split_screen_bricks",
|
||||
self.props,
|
||||
"split_screen_bricks",
|
||||
self.props,
|
||||
"split_screen_active_brick_index",
|
||||
)
|
||||
|
||||
if BrickschemaData.data["active_relations"]:
|
||||
|
||||
@@ -352,8 +352,8 @@ class BIM_PT_cost_item_types(Panel):
|
||||
|
||||
row2 = col.row()
|
||||
row2.template_list(
|
||||
"BIM_UL_cost_item_quantities",
|
||||
"",
|
||||
BIM_UL_cost_item_quantities.__name__,
|
||||
BIM_UL_cost_item_quantities.__name__ + "_cost_item_processes",
|
||||
self.props,
|
||||
"cost_item_processes",
|
||||
self.props,
|
||||
@@ -369,8 +369,8 @@ class BIM_PT_cost_item_types(Panel):
|
||||
|
||||
row2 = col.row()
|
||||
row2.template_list(
|
||||
"BIM_UL_cost_item_quantities",
|
||||
"",
|
||||
BIM_UL_cost_item_quantities.__name__,
|
||||
BIM_UL_cost_item_quantities.__name__ + "_cost_item_resources",
|
||||
self.props,
|
||||
"cost_item_resources",
|
||||
self.props,
|
||||
@@ -439,8 +439,8 @@ class BIM_PT_cost_item_quantities(Panel):
|
||||
row2.prop(self.props, "show_nested_elements", text="Show nested")
|
||||
row2 = col.row()
|
||||
row2.template_list(
|
||||
"BIM_UL_cost_item_quantities",
|
||||
"",
|
||||
BIM_UL_cost_item_quantities.__name__,
|
||||
BIM_UL_cost_item_quantities.__name__ + "_cost_item_products",
|
||||
self.props,
|
||||
"cost_item_products",
|
||||
self.props,
|
||||
@@ -484,8 +484,8 @@ class BIM_PT_cost_item_quantities(Panel):
|
||||
|
||||
row2 = col.row()
|
||||
row2.template_list(
|
||||
"BIM_UL_cost_item_quantities",
|
||||
"",
|
||||
BIM_UL_cost_item_quantities.__name__,
|
||||
BIM_UL_cost_item_quantities.__name__ + "_cost_item_processes",
|
||||
self.props,
|
||||
"cost_item_processes",
|
||||
self.props,
|
||||
@@ -532,8 +532,8 @@ class BIM_PT_cost_item_quantities(Panel):
|
||||
|
||||
row2 = col.row()
|
||||
row2.template_list(
|
||||
"BIM_UL_cost_item_quantities",
|
||||
"",
|
||||
BIM_UL_cost_item_quantities.__name__,
|
||||
BIM_UL_cost_item_quantities.__name__ + "_cost_item_resources",
|
||||
self.props,
|
||||
"cost_item_resources",
|
||||
self.props,
|
||||
|
||||
@@ -183,7 +183,14 @@ class BIM_PT_drawing_underlay(Panel):
|
||||
|
||||
if not dprops.drawing_styles:
|
||||
return
|
||||
layout.template_list("BIM_UL_generic", "", dprops, "drawing_styles", props, "active_drawing_style_index")
|
||||
layout.template_list(
|
||||
"BIM_UL_generic",
|
||||
"BIM_UL_generic_drawing_styles",
|
||||
dprops,
|
||||
"drawing_styles",
|
||||
props,
|
||||
"active_drawing_style_index",
|
||||
)
|
||||
|
||||
if not drawing_index_is_valid:
|
||||
return
|
||||
@@ -326,7 +333,12 @@ class BIM_PT_schedules(Panel):
|
||||
row.operator("bim.remove_schedule", icon="X", text="").schedule = active_schedule.ifc_definition_id
|
||||
|
||||
self.layout.template_list(
|
||||
"BIM_UL_generic", "", self.props, "schedules", self.props, "active_schedule_index"
|
||||
"BIM_UL_generic",
|
||||
"BIM_UL_generic_schedules",
|
||||
self.props,
|
||||
"schedules",
|
||||
self.props,
|
||||
"active_schedule_index",
|
||||
)
|
||||
|
||||
|
||||
@@ -373,7 +385,12 @@ class BIM_PT_references(Panel):
|
||||
row.operator("bim.remove_reference", icon="X", text="").reference = active_reference.ifc_definition_id
|
||||
|
||||
self.layout.template_list(
|
||||
"BIM_UL_generic", "", self.props, "references", self.props, "active_reference_index"
|
||||
"BIM_UL_generic",
|
||||
"BIM_UL_generic_references",
|
||||
self.props,
|
||||
"references",
|
||||
self.props,
|
||||
"active_reference_index",
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -616,8 +616,8 @@ class BIM_PT_animation_Color_Scheme(Panel):
|
||||
row1.label(text="INPUT COLORS", icon="COLLECTION_COLOR_01")
|
||||
row1 = col.row()
|
||||
row1.template_list(
|
||||
"BIM_UL_animation_colors",
|
||||
"",
|
||||
BIM_UL_animation_colors.__name__,
|
||||
BIM_UL_animation_colors.__name__ + "_task_input_colors",
|
||||
self.animation_props,
|
||||
"task_input_colors",
|
||||
self.animation_props,
|
||||
@@ -628,8 +628,8 @@ class BIM_PT_animation_Color_Scheme(Panel):
|
||||
row1.label(text="OUTPUT COLORS", icon="COLLECTION_COLOR_04")
|
||||
row1 = col.row()
|
||||
row1.template_list(
|
||||
"BIM_UL_animation_colors",
|
||||
"",
|
||||
BIM_UL_animation_colors.__name__,
|
||||
BIM_UL_animation_colors.__name__ + "_task_output_colors",
|
||||
self.animation_props,
|
||||
"task_output_colors",
|
||||
self.animation_props,
|
||||
|
||||
Reference in New Issue
Block a user