diff options
author | Julian Eisel <julian@blender.org> | 2021-07-07 19:20:21 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-07-07 19:41:27 +0300 |
commit | 6b0869039a40685e2f4b128b3d08b12c1f3fea75 (patch) | |
tree | a750eeb6603d96ace8c6b0e0d06cf2947898c747 /source/blender/editors/space_file/file_intern.h | |
parent | 13672f8b3244c7c834789f3edb058d938bdd1168 (diff) |
File Browser: Select files and directories after renaming
(Note: This is an alternative version for D9994 by @Schiette. The commit
message is based on his description.)
Currently, when a new directory is created it is not selected.
Similarly, when renaming an existing file or directory, it does not
remain active/highlighted blue after renaming.
This change makes sure the file or directory is always selected after
renaming, even if the renaming failed or was cancelled.
This has some usability advantages:
- Open the newly created directory without having to select it (ENTER).
- If you make a naming mistake, you can immediately fix that (F2)
without having to click it again.
- If you create a directory and forget to name it, you can fix that
(F2) without having to select it.
- This is consistent with many common File Browsers.
Further, selecting the item even after renaming failed or was cancelled
helps keeping the file in focus, so the user doesn't have to look for it
(especially if the renaming just failed which the user may not notice).
In other words, it avoids disorienting the user.
Also see D11119 which requires this behavior.
We could also always select the file/directory on mouse press. This
would make some hacks unnecessary, but may have further implications. I
think eventually that's what we should do though.
Diffstat (limited to 'source/blender/editors/space_file/file_intern.h')
-rw-r--r-- | source/blender/editors/space_file/file_intern.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 060a36febe7..0bbed65671c 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -121,6 +121,10 @@ void file_params_renamefile_clear(struct FileSelectParams *params); void file_params_invoke_rename_postscroll(struct wmWindowManager *wm, struct wmWindow *win, SpaceFile *sfile); +void file_params_rename_end(struct wmWindowManager *wm, + struct wmWindow *win, + SpaceFile *sfile, + struct FileDirEntry *rename_file); void file_params_renamefile_activate(struct SpaceFile *sfile, struct FileSelectParams *params); typedef void *onReloadFnData; |