[Bf-blender-cvs] [52502ad0a4e] blender2.8: UI: WM_OT_call_panel option to keep popovers open
Campbell Barton
noreply at git.blender.org
Wed Jun 6 09:25:30 CEST 2018
Commit: 52502ad0a4ef3ea889ba4876b62ad32b2dbb28f0
Author: Campbell Barton
Date: Wed Jun 6 09:24:24 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB52502ad0a4ef3ea889ba4876b62ad32b2dbb28f0
UI: WM_OT_call_panel option to keep popovers open
===================================================================
M source/blender/windowmanager/intern/wm_operators.c
===================================================================
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 01bf2d96b06..97aad67eda2 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2246,8 +2246,9 @@ static int wm_call_panel_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "name", idname);
const int space_type = RNA_enum_get(op->ptr, "space_type");
const int region_type = RNA_enum_get(op->ptr, "region_type");
+ const bool keep_open = RNA_enum_get(op->ptr, "region_type");
- return UI_popover_panel_invoke(C, space_type, region_type, idname, true, op->reports);
+ return UI_popover_panel_invoke(C, space_type, region_type, idname, keep_open, op->reports);
}
static void WM_OT_call_panel(wmOperatorType *ot)
@@ -2261,9 +2262,16 @@ static void WM_OT_call_panel(wmOperatorType *ot)
ot->flag = OPTYPE_INTERNAL;
- RNA_def_string(ot->srna, "name", NULL, BKE_ST_MAXNAME, "Name", "Name of the menu");
- RNA_def_enum(ot->srna, "space_type", rna_enum_space_type_items, SPACE_EMPTY, "Space Type", "");
- RNA_def_enum(ot->srna, "region_type", rna_enum_region_type_items, RGN_TYPE_WINDOW, "Region Type", "");
+ PropertyRNA *prop;
+
+ prop = RNA_def_string(ot->srna, "name", NULL, BKE_ST_MAXNAME, "Name", "Name of the menu");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+ prop = RNA_def_enum(ot->srna, "space_type", rna_enum_space_type_items, SPACE_EMPTY, "Space Type", "");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+ prop = RNA_def_enum(ot->srna, "region_type", rna_enum_region_type_items, RGN_TYPE_WINDOW, "Region Type", "");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+ prop = RNA_def_boolean(ot->srna, "keep_open", true, "Keep Open", "");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
/* ************ window / screen operator definitions ************** */
More information about the Bf-blender-cvs
mailing list