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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_text.c')
-rw-r--r--source/blender/makesrna/intern/rna_text.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c
index 454367b5233..b09b5327f57 100644
--- a/source/blender/makesrna/intern/rna_text.c
+++ b/source/blender/makesrna/intern/rna_text.c
@@ -146,6 +146,13 @@ static void rna_def_text_line(BlenderRNA *brna)
static void rna_def_text(BlenderRNA *brna)
{
+
+ static const EnumPropertyItem indentation_items[] = {
+ {0, "TABS", 0, "Tabs", "Indent using tabs"},
+ {TXT_TABSTOSPACES, "SPACES", 0, "Spaces", "Indent using spaces"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
StructRNA *srna;
PropertyRNA *prop;
@@ -182,10 +189,10 @@ static void rna_def_text(BlenderRNA *brna)
RNA_def_property_ui_text(
prop, "Register", "Run this text as a script on loading, Text name must end with \".py\"");
- prop = RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_TABSTOSPACES);
- RNA_def_property_ui_text(
- prop, "Tabs as Spaces", "Automatically converts all new tabs into spaces");
+ prop = RNA_def_property(srna, "indentation", PROP_ENUM, PROP_NONE); /* as an enum */
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
+ RNA_def_property_enum_items(prop, indentation_items);
+ RNA_def_property_ui_text(prop, "Indentation", "Use tabs or spaces for indentation");
prop = RNA_def_property(srna, "lines", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "TextLine");