Fix: Do not show WM_OT_clear_recent_files on Splash

New operator to clear recent files list should show in the topbar list,
but not be shown on the Splash screen list.

Pull Request: https://projects.blender.org/blender/blender/pulls/116785
This commit is contained in:
Jonas Holzman 2024-01-04 17:50:03 +01:00 committed by Harley Acheson
parent 5412bd48a9
commit 00ef4f9309
2 changed files with 5 additions and 6 deletions

View File

@ -7310,11 +7310,6 @@ int uiTemplateRecentFiles(uiLayout *layout, int rows)
but, uiTemplateRecentFiles_tooltip_func, BLI_strdup(recent->filepath), MEM_freeN);
}
if (i > 0) {
uiItemS(layout);
uiItemO(layout, nullptr, ICON_TRASH, "WM_OT_clear_recent_files");
}
return i;
}

View File

@ -190,7 +190,11 @@ static void recent_files_menu_draw(const bContext * /*C*/, Menu *menu)
{
uiLayout *layout = menu->layout;
uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_DEFAULT);
if (uiTemplateRecentFiles(layout, U.recent_files) == 0) {
if (uiTemplateRecentFiles(layout, U.recent_files) != 0) {
uiItemS(layout);
uiItemO(layout, nullptr, ICON_TRASH, "WM_OT_clear_recent_files");
}
else {
uiItemL(layout, IFACE_("No Recent Files"), ICON_NONE);
}
}