From d8c2c63c005b686c7489b06b889cd30cf9eeea9c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 16 Jun 2018 14:48:21 +0200 Subject: UI: Add property decorator buttons When use_property_split is enabled, this template adds buttons to set keyframes, (Alternative to showing color). See: T54951 --- source/blender/makesrna/intern/rna_ui.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/blender/makesrna/intern/rna_ui.c') diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 8083ae35dc1..70aa4709d8c 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -963,6 +963,16 @@ static void rna_UILayout_property_split_set(PointerRNA *ptr, int value) uiLayoutSetPropSep(ptr->data, value); } +static int rna_UILayout_property_decorate_get(PointerRNA *ptr) +{ + return uiLayoutGetPropDecorate(ptr->data); +} + +static void rna_UILayout_property_decorate_set(PointerRNA *ptr, int value) +{ + uiLayoutSetPropDecorate(ptr->data, value); +} + #else /* RNA_RUNTIME */ static void rna_def_ui_layout(BlenderRNA *brna) @@ -1030,6 +1040,9 @@ static void rna_def_ui_layout(BlenderRNA *brna) prop = RNA_def_property(srna, "use_property_split", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_UILayout_property_split_get", "rna_UILayout_property_split_set"); + + prop = RNA_def_property(srna, "use_property_decorate", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_UILayout_property_decorate_get", "rna_UILayout_property_decorate_set"); } static void rna_def_panel(BlenderRNA *brna) -- cgit v1.2.3