Fix purging types in the type manager not working. The purge button is now in a menu for a cleaner interface and avoiding accidentally clicking on it when opening the type manager.

This commit is contained in:
Gorgious56
2024-09-20 12:09:55 +02:00
parent 6d94871683
commit 07291022b4
2 changed files with 12 additions and 0 deletions
@@ -135,6 +135,7 @@ classes = (
ui.BIM_PT_door,
ui.BIM_PT_railing,
ui.BIM_PT_roof,
ui.BIM_MT_type_manager_menu,
ui.LaunchTypeManager,
ui.BIM_MT_model,
grid.BIM_OT_add_object,
+11
View File
@@ -40,6 +40,15 @@ from bonsai.bim.helper import prop_with_search
from collections.abc import Iterable
class BIM_MT_type_manager_menu(bpy.types.Menu):
bl_label = "Type Manager Menu"
bl_idname = "BIM_MT_type_manager_menu"
def draw(self, context):
layout = self.layout
layout.operator("bim.purge_unused_objects", text="Purge Unused Types", icon="TRASH").object_type = "TYPE"
class LaunchTypeManager(bpy.types.Operator):
bl_idname = "bim.launch_type_manager"
bl_label = "Launch Type Manager"
@@ -69,6 +78,8 @@ class LaunchTypeManager(bpy.types.Operator):
row = self.layout.row(align=True)
prop_with_search(row, props, "type_class", text="", should_click_ok_to_validate=True)
row.menu("BIM_MT_type_manager_menu", text="", icon="PREFERENCES")
columns = self.layout.column_flow(columns=3)
row = columns.row()
row.alignment = "LEFT"