diff options
author | William Reynish <billrey@me.com> | 2019-08-04 13:51:28 +0300 |
---|---|---|
committer | William Reynish <billrey@me.com> | 2019-08-04 13:51:28 +0300 |
commit | a2fe386153ee976bf5b687257f117ca4efb1ef8f (patch) | |
tree | acb3754063b1a98c62292896850a6832cb992d28 /source/blender/makesrna | |
parent | c0aada58c9820b36176ec54d281513eeac65ca0c (diff) |
Text Editor UI
Tweak Text Editor to fit better with the rest of Blender 2.8:
- Move sidebar to the right
- Add proper context menu
- Move view toggles to the View menu
- Change the indentation option to be an enum between spaces and tabs
- Several layout tweaks
Patch by @tintwotin / Peter Fog with additional tweaks by me.
Differential Revision https://developer.blender.org/D5028
Reviewers: Brecht, Campbell
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_text.c | 15 |
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"); |