Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorThomas Beck <software@plasmasolutions.de>2015-09-16 23:03:06 +0300
committerThomas Beck <software@plasmasolutions.de>2015-09-16 23:08:04 +0300
commit4fb9cc24a8b9bd37e2a668f8466976b0d24ed8dc (patch)
tree623dbcd9160d65c5934f1682e8c48d6c84702756 /source
parent9d087ad0b572cc42572034fa1fa8eb987faa7a3c (diff)
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!
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_file/file_draw.c15
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, "");