diff options
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index dac9124a4cb..a77375a2214 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -232,9 +232,18 @@ void file_draw_buttons(const bContext *C, ARegion *ar) /* Execute / cancel buttons. */ if (loadbutton) { const struct FileDirEntry *file = sfile->files ? filelist_file(sfile->files, params->active_file) : NULL; - const char *str_exec = (file && (file->typeflag & FILE_TYPE_FOLDER)) ? - /* params->title is already translated! */ - IFACE_("Open Directory") : params->title; + + char const *str_exec; + if (file) { + const bool is_parent_dir = (FILENAME_IS_PARENT(file->relpath)); + if (is_parent_dir){ + str_exec = IFACE_("Parent Directory"); + } else if (file->typeflag & FILE_TYPE_DIR) { + str_exec = IFACE_("Open Directory"); + } + } else { + str_exec = params->title; /* params->title is already translated! */ + } uiDefButO(block, UI_BTYPE_BUT, "FILE_OT_execute", WM_OP_EXEC_REGION_WIN, str_exec, max_x - loadbutton, line1_y, loadbutton, btn_h, ""); |