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:
authorCampbell Barton <ideasman42@gmail.com>2018-07-26 06:50:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-26 07:45:14 +0300
commit2e12114f3b9f3ac94a0a8fe7a184524f4593ddf9 (patch)
treedf7a5362dfd1adce1ca6aba950bb1d6919e47601 /source/blender/editors/space_file
parent1882dfc47c18c9b715c36eb7a76d01a306a10580 (diff)
parentdbd79c097c14d486fe79b91b916a9f854587b27e (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r--source/blender/editors/space_file/file_panels.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c
index 812a671ff33..abe9f173b09 100644
--- a/source/blender/editors/space_file/file_panels.c
+++ b/source/blender/editors/space_file/file_panels.c
@@ -43,6 +43,7 @@
#include "MEM_guardedalloc.h"
#include "RNA_access.h"
+#include "RNA_define.h"
#include "ED_fileselect.h"
@@ -71,25 +72,28 @@ static void file_panel_operator_header(const bContext *C, Panel *pa)
BLI_strncpy(pa->drawname, RNA_struct_ui_name(op->type->srna), sizeof(pa->drawname));
}
-static bool file_panel_check_prop(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
-{
- const char *prop_id = RNA_property_identifier(prop);
- return !(STREQ(prop_id, "filepath") ||
- STREQ(prop_id, "directory") ||
- STREQ(prop_id, "filename")
- );
-}
-
static void file_panel_operator(const bContext *C, Panel *pa)
{
SpaceFile *sfile = CTX_wm_space_file(C);
wmOperator *op = sfile->op;
- // int empty = 1, flag;
UI_block_func_set(uiLayoutGetBlock(pa->layout), file_draw_check_cb, NULL, NULL);
- uiTemplateOperatorPropertyButs(C, pa->layout, op, file_panel_check_prop, UI_BUT_LABEL_ALIGN_NONE,
- UI_TEMPLATE_OP_PROPS_SHOW_EMPTY);
+ /* Hack: temporary hide.*/
+ const char *hide[3] = {"filepath", "directory", "filename"};
+ for (int i = 0; i < ARRAY_SIZE(hide); i++) {
+ PropertyRNA *prop = RNA_struct_find_property(op->ptr, "filepath");
+ RNA_def_property_flag(prop, PROP_HIDDEN);
+ }
+
+ uiTemplateOperatorPropertyButs(
+ C, pa->layout, op, UI_BUT_LABEL_ALIGN_NONE,
+ UI_TEMPLATE_OP_PROPS_SHOW_EMPTY);
+
+ for (int i = 0; i < ARRAY_SIZE(hide); i++) {
+ PropertyRNA *prop = RNA_struct_find_property(op->ptr, "filepath");
+ RNA_def_property_clear_flag(prop, PROP_HIDDEN);
+ }
UI_block_func_set(uiLayoutGetBlock(pa->layout), NULL, NULL, NULL);
}