Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_topbar/space_topbar.c
| Show First 20 Lines • Show All 207 Lines • ▼ Show 20 Lines | static void topbar_header_region_message_subscribe(const struct bContext *UNUSED(C), | ||||
| WM_msg_subscribe_rna_prop( | WM_msg_subscribe_rna_prop( | ||||
| mbus, &workspace->id, workspace, WorkSpace, tools, &msg_sub_value_region_tag_redraw); | mbus, &workspace->id, workspace, WorkSpace, tools, &msg_sub_value_region_tag_redraw); | ||||
| } | } | ||||
| static void recent_files_menu_draw(const bContext *UNUSED(C), Menu *menu) | static void recent_files_menu_draw(const bContext *UNUSED(C), Menu *menu) | ||||
| { | { | ||||
| struct RecentFile *recent; | struct RecentFile *recent; | ||||
| uiLayout *layout = menu->layout; | uiLayout *layout = menu->layout; | ||||
| uiLayoutSetOperatorContext(layout, WM_OP_EXEC_REGION_WIN); | uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_DEFAULT); | ||||
| if (!BLI_listbase_is_empty(&G.recent_files)) { | if (!BLI_listbase_is_empty(&G.recent_files)) { | ||||
| for (recent = G.recent_files.first; (recent); recent = recent->next) { | for (recent = G.recent_files.first; (recent); recent = recent->next) { | ||||
| const char *file = BLI_path_basename(recent->filepath); | const char *file = BLI_path_basename(recent->filepath); | ||||
| const int icon = BLO_has_bfile_extension(file) ? ICON_FILE_BLEND : ICON_FILE_BACKUP; | const int icon = BLO_has_bfile_extension(file) ? ICON_FILE_BLEND : ICON_FILE_BACKUP; | ||||
| uiItemStringO(layout, file, icon, "WM_OT_open_mainfile", "filepath", recent->filepath); | PointerRNA ptr; | ||||
| uiItemFullO(layout, "WM_OT_open_mainfile", file, icon, NULL, WM_OP_INVOKE_DEFAULT, 0, &ptr); | |||||
| RNA_string_set(&ptr, "filepath", recent->filepath); | |||||
| RNA_boolean_set(&ptr, "display_file_selector", false); | |||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| uiItemL(layout, IFACE_("No Recent Files"), ICON_NONE); | uiItemL(layout, IFACE_("No Recent Files"), ICON_NONE); | ||||
| } | } | ||||
| } | } | ||||
| static void recent_files_menu_register(void) | static void recent_files_menu_register(void) | ||||
| ▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines | |||||