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
diff options
context:
space:
mode:
authorJulian Eisel <eiseljulian@gmail.com>2019-09-06 02:22:35 +0300
committerJulian Eisel <eiseljulian@gmail.com>2019-09-06 02:31:45 +0300
commit9972d6c3062010bea514c9e382b0a99275d63a89 (patch)
treed142b202d8f7c02b3991e8e6aa9064195bc7ebce /source/blender/editors/interface/interface_templates.c
parent4c4a8bf588c52e05f868a89938fa09e6f25ba1d8 (diff)
UI: Bring back features for file path button
Adds back auto-completion and auto-creation (inserting a non-existing file-path would create it) for the file path button. The second feature was left out knowingly, but seems there are reasonable use cases for it. We can't add these features to the button in the Python script, we have to call into C. So using a template to do that. Note that this is based on the old file browser code, I've copied over the TODO comment.
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r--source/blender/editors/interface/interface_templates.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 62eebfdd3c7..0dfa6e9ddf5 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -76,6 +76,7 @@
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
+#include "ED_fileselect.h"
#include "ED_screen.h"
#include "ED_object.h"
#include "ED_render.h"
@@ -6779,3 +6780,13 @@ int uiTemplateRecentFiles(uiLayout *layout, int rows)
return i;
}
+
+/******************************* FileSelectParams Path Button *******************************/
+
+void uiTemplateFileSelectPath(uiLayout *layout, bContext *C, FileSelectParams *params)
+{
+ bScreen *screen = CTX_wm_screen(C);
+ SpaceFile *sfile = CTX_wm_space_file(C);
+
+ ED_file_path_button(screen, sfile, params, uiLayoutGetBlock(layout));
+}