Recent files - dim button for filepaths that do not exist

Example - https://i.imgur.com/dwEBtG6.png
This commit is contained in:
Andrej730
2025-02-04 12:38:48 +05:00
parent a4de196259
commit 76747bdf5a
+4 -1
View File
@@ -54,16 +54,19 @@ class BIM_MT_recent_projects(Menu):
bl_label = "Open Recent IFC Project"
def draw(self, context):
layout = self.layout
paths = tool.Project.get_recent_ifc_projects()
if not paths:
self.layout.label(text="No Recent IFC Projects")
return
for path in paths:
op = self.layout.operator("bim.load_project", text=path.name, icon_value=bonsai.bim.icons["IFC"].icon_id)
row = layout.row()
op = row.operator("bim.load_project", text=path.name, icon_value=bonsai.bim.icons["IFC"].icon_id)
op.filepath = str(path)
op.should_start_fresh_session = True
op.use_detailed_tooltip = True
row.enabled = path.is_file()
self.layout.separator()
self.layout.operator("bim.clear_recent_ifc_projects", icon="TRASH")