diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2019-09-06 02:22:35 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2019-09-06 02:31:45 +0300 |
commit | 9972d6c3062010bea514c9e382b0a99275d63a89 (patch) | |
tree | d142b202d8f7c02b3991e8e6aa9064195bc7ebce /source/blender/makesrna/intern/rna_ui_api.c | |
parent | 4c4a8bf588c52e05f868a89938fa09e6f25ba1d8 (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/makesrna/intern/rna_ui_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ui_api.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index c8b039bd2d6..74d1743dfc1 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -1519,6 +1519,13 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_int(func, "rows", 5, 1, INT_MAX, "", "Maximum number of items to show", 1, INT_MAX); parm = RNA_def_int(func, "found", 0, 0, INT_MAX, "", "Number of items drawn", 0, INT_MAX); RNA_def_function_return(func, parm); + + func = RNA_def_function(srna, "template_file_select_path", "uiTemplateFileSelectPath"); + RNA_def_function_ui_description(func, + "Item. A text button to set the active file browser path."); + parm = RNA_def_pointer(func, "params", "FileSelectParams", "", ""); + RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); } #endif |