diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_userdef.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index f1aaa13fcf5..ed89faf69cf 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -69,7 +69,7 @@ static const EnumPropertyItem opensubdiv_compute_type_items[] = { }; #endif -static const EnumPropertyItem preference_section_items[] = { +const EnumPropertyItem rna_enum_preference_section_items[] = { {USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""}, {USER_SECTION_THEME, "THEMES", 0, "Themes", ""}, {USER_SECTION_VIEWPORT, "VIEWPORT", 0, "Viewport", ""}, @@ -92,6 +92,8 @@ static const EnumPropertyItem preference_section_items[] = { {USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""}, {USER_SECTION_SAVE_LOAD, "SAVE_LOAD", 0, "Save & Load", ""}, {USER_SECTION_FILE_PATHS, "FILE_PATHS", 0, "File Paths", ""}, + {0, "", 0, NULL, NULL}, + {USER_SECTION_EXPERIMENTAL, "EXPERIMENTAL", 0, "Experimental", ""}, {0, NULL, 0, NULL, NULL}, }; @@ -468,26 +470,22 @@ static const EnumPropertyItem *rna_UseDef_active_section_itemf(bContext *UNUSED( { UserDef *userdef = ptr->data; - if ((userdef->flag & USER_DEVELOPER_UI) == 0) { + if ((userdef->flag & USER_DEVELOPER_UI) != 0) { *r_free = false; - return preference_section_items; + return rna_enum_preference_section_items; } EnumPropertyItem *items = NULL; int totitem = 0; - RNA_enum_items_add(&items, &totitem, preference_section_items); - RNA_enum_item_add_separator(&items, &totitem); - - EnumPropertyItem item = { - .value = USER_SECTION_EXPERIMENTAL, - .name = "Experimental", - .identifier = "EXPERIMENTAL", - .icon = 0, - .description = "", - }; + for (const EnumPropertyItem *it = rna_enum_preference_section_items; it->identifier != NULL; + it++) { + if (it->value == USER_SECTION_EXPERIMENTAL) { + continue; + } + RNA_enum_item_add(&items, &totitem, it); + } - RNA_enum_item_add(&items, &totitem, &item); RNA_enum_item_end(&items, &totitem); *r_free = true; @@ -5942,7 +5940,7 @@ void RNA_def_userdef(BlenderRNA *brna) prop = RNA_def_property(srna, "active_section", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "space_data.section_active"); - RNA_def_property_enum_items(prop, preference_section_items); + RNA_def_property_enum_items(prop, rna_enum_preference_section_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_UseDef_active_section_itemf"); RNA_def_property_ui_text( prop, "Active Section", "Active section of the preferences shown in the user interface"); |