From 4fb9cc24a8b9bd37e2a668f8466976b0d24ed8dc Mon Sep 17 00:00:00 2001 From: Thomas Beck Date: Wed, 16 Sep 2015 22:03:06 +0200 Subject: Fix (unreported): Filebrowser key navigation entry did not change caption correctly As of this release we're able to navigate with the keyboard in the filebrowsing area. The button caption is changing to an appropriate string whenever a new entry is selected. In @Severins original code a different method was used to determine if a directory was choosen or not, but this got lost while merging the filebrowser rework. Thanks to @mont29 for review! --- source/blender/editors/space_file/file_draw.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'source/blender') 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, ""); -- cgit v1.2.3