diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-20 03:59:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-20 03:59:31 +0300 |
commit | 91240f15c54632409da3f09d1c3eb40e6f66e52d (patch) | |
tree | 85d94415556b12728864a024dd64f871ef9b57d8 /source/blender/makesrna | |
parent | 756be8f4d8ff2ba3915b67c36c2e40f1652397da (diff) |
UI: add UILayout.direction
Read only attribute, needed for introspection.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_ui.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index ea39ce72598..7c792f04f02 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -950,6 +950,11 @@ static void rna_UILayout_alignment_set(PointerRNA *ptr, int value) uiLayoutSetAlignment(ptr->data, value); } +static int rna_UILayout_direction_get(PointerRNA *ptr) +{ + return uiLayoutGetLocalDir(ptr->data); +} + static float rna_UILayout_scale_x_get(PointerRNA *ptr) { return uiLayoutGetScaleX(ptr->data); @@ -1035,6 +1040,12 @@ static void rna_def_ui_layout(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; + static const EnumPropertyItem direction_items[] = { + {UI_LAYOUT_HORIZONTAL, "HORIZONTAL", 0, "Horizontal", ""}, + {UI_LAYOUT_VERTICAL, "VERTICAL", 0, "Vertical", ""}, + {0, NULL, 0, NULL, NULL} + }; + static const EnumPropertyItem emboss_items[] = { {UI_EMBOSS, "NORMAL", 0, "Normal", "Draw standard button emboss style"}, {UI_EMBOSS_NONE, "NONE", 0, "None", "Draw only text and icons"}, @@ -1067,6 +1078,11 @@ static void rna_def_ui_layout(BlenderRNA *brna) RNA_def_property_enum_items(prop, alignment_items); RNA_def_property_enum_funcs(prop, "rna_UILayout_alignment_get", "rna_UILayout_alignment_set", NULL); + prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, direction_items); + RNA_def_property_enum_funcs(prop, "rna_UILayout_direction_get", NULL, NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + #if 0 prop = RNA_def_property(srna, "keep_aspect", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_UILayout_keep_aspect_get", "rna_UILayout_keep_aspect_set"); |