diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-02 08:16:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-02 08:16:41 +0400 |
commit | 479b330ac5b33ee12f4c3c683b6888ed709b9b81 (patch) | |
tree | 821e02bb6c72fcd4c3e781ca6e4a11a73faf12cc | |
parent | 0fadb7e47968b73189ea11d832be582a63fda1e6 (diff) |
don't show an 'X' next to never-null pointer search menus.
also set ShapeKey.relative_key to never-null.
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_key.c | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index dd6479bff71..f781da1b810 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1411,7 +1411,7 @@ void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRN /* turn button into search button */ if (searchprop) { - if (RNA_property_flag(prop) & PROP_NEVER_UNLINK) + if (RNA_property_flag(prop) & (PROP_NEVER_UNLINK | PROP_NEVER_NULL)) but->type = SEARCH_MENU; else but->type = SEARCH_MENU_UNLINK; diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 458ca9edc5c..eae06bbf5fc 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -577,7 +577,9 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str } /* delete button */ - if (id && (flag & UI_ID_DELETE) && (RNA_property_flag(template->prop) & PROP_NEVER_UNLINK) == 0) { + if (id && (flag & UI_ID_DELETE) && + (RNA_property_flag(template->prop) & (PROP_NEVER_UNLINK | PROP_NEVER_NULL)) == 0) + { if (unlinkop) { but = uiDefIconButO(block, BUT, unlinkop, WM_OP_INVOKE_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL); /* so we can access the template from operators, font unlinking needs this */ diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 4e8b8d7b1a7..3a2677c8398 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -572,7 +572,7 @@ static void rna_def_keyblock(BlenderRNA *brna) prop = RNA_def_property(srna, "relative_key", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ShapeKey"); - RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL); RNA_def_property_pointer_funcs(prop, "rna_ShapeKey_relative_key_get", "rna_ShapeKey_relative_key_set", NULL, NULL); RNA_def_property_ui_text(prop, "Relative Key", "Shape used as a relative key"); |