mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Recent files - dim button for filepaths that do not exist
Example - https://i.imgur.com/dwEBtG6.png
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user