From a621d1e48828d02a5e097dcfc218cc11d149e75f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 17 Dec 2013 03:21:55 +1100 Subject: UI: Tabs categories for panels (D75) - works by defining panel categories, currently restricted to the toolbar. - no panels define bl_categories yet, so no user visible changes since tabs only show when there are multiple. - panel pinning is available in rmb menu or alt+lmb. --- source/blender/makesrna/intern/rna_ui.c | 11 +++++++++++ 1 file changed, 11 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 39f305f7d47..a82763994f8 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -980,6 +980,11 @@ static void rna_def_panel(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); RNA_define_verify_sdna(TRUE); + prop = RNA_def_property(srna, "bl_category", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "type->category"); + RNA_def_property_string_default(prop, BLF_I18NCONTEXT_DEFAULT_BPYRNA); + RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); + prop = RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type->space_type"); RNA_def_property_enum_items(prop, space_type_items); @@ -1004,6 +1009,12 @@ static void rna_def_panel(BlenderRNA *brna) RNA_def_property_enum_items(prop, panel_flag_items); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL | PROP_ENUM_FLAG); RNA_def_property_ui_text(prop, "Options", "Options for this panel type"); + + prop = RNA_def_property(srna, "use_pin", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PNL_PIN); + RNA_def_property_ui_text(prop, "Pin", ""); + /* XXX, should only tag region for redraw */ + RNA_def_property_update(prop, NC_WINDOW, NULL); } static void rna_def_uilist(BlenderRNA *brna) -- cgit v1.2.3