diff options
Diffstat (limited to 'source/blender/editors/space_info/space_info.c')
-rw-r--r-- | source/blender/editors/space_info/space_info.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index f7bf7715436..98aa2ca0a9c 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -58,6 +58,7 @@ #include "UI_view2d.h" #include "info_intern.h" /* own include */ +#include "BLO_readfile.h" /* ******************** default callbacks for info space ***************** */ @@ -93,7 +94,7 @@ static SpaceLink *info_new(const bContext *UNUSED(C)) ar->v2d.minzoom = ar->v2d.maxzoom = 1.0f; /* for now, aspect ratio should be maintained, and zoom is clamped within sane default limits */ - //ar->v2d.keepzoom= (V2D_KEEPASPECT|V2D_LIMITZOOM); + //ar->v2d.keepzoom = (V2D_KEEPASPECT|V2D_LIMITZOOM); return (SpaceLink *)sinfo; } @@ -228,7 +229,7 @@ static void info_header_area_draw(const bContext *C, ARegion *ar) static void info_main_area_listener(ARegion *ar, wmNotifier *wmn) { - // SpaceInfo *sinfo= sa->spacedata.first; + // SpaceInfo *sinfo = sa->spacedata.first; /* context changes */ switch (wmn->category) { @@ -249,7 +250,7 @@ static void info_header_listener(ARegion *ar, wmNotifier *wmn) if (ELEM(wmn->data, ND_SCREENCAST, ND_ANIMPLAY)) ED_region_tag_redraw(ar); break; - case NC_WM: + case NC_WM: if (wmn->data == ND_JOB) ED_region_tag_redraw(ar); break; @@ -257,7 +258,7 @@ static void info_header_listener(ARegion *ar, wmNotifier *wmn) if (wmn->data == ND_RENDER_RESULT) ED_region_tag_redraw(ar); break; - case NC_SPACE: + case NC_SPACE: if (wmn->data == ND_SPACE_INFO) ED_region_tag_redraw(ar); break; @@ -271,11 +272,16 @@ static void info_header_listener(ARegion *ar, wmNotifier *wmn) static void recent_files_menu_draw(const bContext *UNUSED(C), Menu *menu) { struct RecentFile *recent; + char file [FILE_MAX]; uiLayout *layout = menu->layout; uiLayoutSetOperatorContext(layout, WM_OP_EXEC_REGION_WIN); if (G.recent_files.first) { for (recent = G.recent_files.first; (recent); recent = recent->next) { - uiItemStringO(layout, BLI_path_basename(recent->filepath), ICON_FILE_BLEND, "WM_OT_open_mainfile", "filepath", recent->filepath); + BLI_split_file_part(recent->filepath, file, sizeof(file)); + if (BLO_has_bfile_extension(file)) + uiItemStringO(layout, BLI_path_basename(recent->filepath), ICON_FILE_BLEND, "WM_OT_open_mainfile", "filepath", recent->filepath); + else + uiItemStringO(layout, BLI_path_basename(recent->filepath), ICON_FILE_BACKUP, "WM_OT_open_mainfile", "filepath", recent->filepath); } } else { |