diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-14 07:24:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-14 07:24:41 +0400 |
commit | fc0ad3c42a6490cf4553c25ca6fc52adcb688192 (patch) | |
tree | fd3a00491043ba489f7a0fc11181ebea456708f1 /source | |
parent | c5023e4bb9e10dea2a543e07b465df464752baa1 (diff) |
theme settings - split space and space list into their own RNA members, display with own heading in userprefs.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/RNA_access.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 148 |
2 files changed, 103 insertions, 47 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 569449f70df..b6e76c62e04 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -546,6 +546,8 @@ extern StructRNA RNA_ThemeNodeEditor; extern StructRNA RNA_ThemeOutliner; extern StructRNA RNA_ThemeProperties; extern StructRNA RNA_ThemeSequenceEditor; +extern StructRNA RNA_ThemeSpaceGeneric; +extern StructRNA RNA_ThemeSpaceListGeneric; extern StructRNA RNA_ThemeStyle; extern StructRNA RNA_ThemeTextEditor; extern StructRNA RNA_ThemeTimeline; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index d19498776a0..7b3c70aa896 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -312,6 +312,17 @@ static void rna_userdef_text_update(Main *UNUSED(bmain), Scene *UNUSED(scene), P WM_main_add_notifier(NC_WINDOW, NULL); } +static PointerRNA rna_Theme_space_generic_get(PointerRNA *ptr) +{ + return rna_pointer_inherit_refine(ptr, &RNA_ThemeSpaceGeneric, ptr->data); +} + +static PointerRNA rna_Theme_space_list_generic_get(PointerRNA *ptr) +{ + return rna_pointer_inherit_refine(ptr, &RNA_ThemeSpaceListGeneric, ptr->data); +} + + #ifdef WITH_CYCLES static EnumPropertyItem *rna_userdef_compute_device_type_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { @@ -711,10 +722,15 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_userdef_update"); } -static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype) +static void rna_def_userdef_theme_space_generic(BlenderRNA *brna) { + StructRNA *srna; PropertyRNA *prop; + srna= RNA_def_struct(brna, "ThemeSpaceGeneric", NULL); + RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_ui_text(srna, "Theme Space Settings", ""); + /* window */ prop= RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -725,7 +741,7 @@ static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Title", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Text", ""); @@ -746,57 +762,87 @@ static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Header Text", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop= RNA_def_property(srna, "header_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Header Text Highlight", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + /* buttons */ // if(! ELEM(spacetype, SPACE_BUTS, SPACE_OUTLINER)) { prop= RNA_def_property(srna, "button", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Region Background", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop= RNA_def_property(srna, "button_title", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Region Text Titles", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop= RNA_def_property(srna, "button_text", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Region Text", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop= RNA_def_property(srna, "button_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Region Text Highlight", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); // } - - /* list/channels */ - if(ELEM5(spacetype, SPACE_IPO, SPACE_ACTION, SPACE_NLA, SPACE_NODE, SPACE_FILE)) { - prop= RNA_def_property(srna, "list", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Source List", ""); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - - prop= RNA_def_property(srna, "list_title", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Source List Title", ""); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - - prop= RNA_def_property(srna, "list_text", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Source List Text", ""); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - - prop= RNA_def_property(srna, "list_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Source List Text Highlight", ""); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - } +} + +/* list / channels */ +static void rna_def_userdef_theme_space_list_generic(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "ThemeSpaceListGeneric", NULL); + RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_ui_text(srna, "Theme Space List Settings", ""); + + prop= RNA_def_property(srna, "list", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Source List", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "list_title", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Source List Title", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "list_text", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Source List Text", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "list_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Source List Text Highlight", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); +} + +static void rna_def_userdef_theme_spaces_main(StructRNA *srna) +{ + PropertyRNA *prop; + + prop= RNA_def_property(srna, "space", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_struct_type(prop, "ThemeSpaceGeneric"); + RNA_def_property_pointer_funcs(prop, "rna_Theme_space_generic_get", NULL, NULL, NULL); + RNA_def_property_ui_text(prop, "Theme Space", "Settings for space"); +} + +static void rna_def_userdef_theme_spaces_list_main(StructRNA *srna) +{ + PropertyRNA *prop; + + prop= RNA_def_property(srna, "space_list", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_struct_type(prop, "ThemeSpaceListGeneric"); + RNA_def_property_pointer_funcs(prop, "rna_Theme_space_list_generic_get", NULL, NULL, NULL); + RNA_def_property_ui_text(prop, "Theme Space List", "Settings for space list"); } static void rna_def_userdef_theme_spaces_vertex(StructRNA *srna) @@ -992,7 +1038,7 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme 3D View", "Theme settings for the 3D View"); - rna_def_userdef_theme_spaces_main(srna, SPACE_VIEW3D); + rna_def_userdef_theme_spaces_main(srna); prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -1130,7 +1176,8 @@ static void rna_def_userdef_theme_space_graph(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the graph editor"); - rna_def_userdef_theme_spaces_main(srna, SPACE_IPO); + rna_def_userdef_theme_spaces_main(srna); + rna_def_userdef_theme_spaces_list_main(srna); prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -1215,7 +1262,8 @@ static void rna_def_userdef_theme_space_file(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme File Browser", "Theme settings for the File Browser"); - rna_def_userdef_theme_spaces_main(srna, SPACE_FILE); + rna_def_userdef_theme_spaces_main(srna); + rna_def_userdef_theme_spaces_list_main(srna); prop= RNA_def_property(srna, "selected_file", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "hilite"); @@ -1265,7 +1313,7 @@ static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Outliner", "Theme settings for the Outliner"); - rna_def_userdef_theme_spaces_main(srna, SPACE_OUTLINER); + rna_def_userdef_theme_spaces_main(srna); } static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna) @@ -1279,7 +1327,7 @@ static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme User Preferences", "Theme settings for the User Preferences"); - rna_def_userdef_theme_spaces_main(srna, SPACE_USERPREF); + rna_def_userdef_theme_spaces_main(srna); } static void rna_def_userdef_theme_space_console(BlenderRNA *brna) @@ -1294,7 +1342,7 @@ static void rna_def_userdef_theme_space_console(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Console", "Theme settings for the Console"); - rna_def_userdef_theme_spaces_main(srna, SPACE_CONSOLE); + rna_def_userdef_theme_spaces_main(srna); prop= RNA_def_property(srna, "line_output", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "console_output"); @@ -1338,7 +1386,7 @@ static void rna_def_userdef_theme_space_info(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Info", "Theme settings for Info"); - rna_def_userdef_theme_spaces_main(srna, SPACE_INFO); + rna_def_userdef_theme_spaces_main(srna); } @@ -1354,7 +1402,7 @@ static void rna_def_userdef_theme_space_text(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Text Editor", "Theme settings for the Text Editor"); - rna_def_userdef_theme_spaces_main(srna, SPACE_TEXT); + rna_def_userdef_theme_spaces_main(srna); prop= RNA_def_property(srna, "line_numbers_background", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "grid"); @@ -1423,7 +1471,8 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Node Editor", "Theme settings for the Node Editor"); - rna_def_userdef_theme_spaces_main(srna, SPACE_NODE); + rna_def_userdef_theme_spaces_main(srna); + rna_def_userdef_theme_spaces_list_main(srna); prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "wire"); @@ -1493,7 +1542,7 @@ static void rna_def_userdef_theme_space_logic(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Logic Editor", "Theme settings for the Logic Editor"); - rna_def_userdef_theme_spaces_main(srna, SPACE_LOGIC); + rna_def_userdef_theme_spaces_main(srna); prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -1514,7 +1563,7 @@ static void rna_def_userdef_theme_space_buts(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Properties", "Theme settings for the Properties"); - rna_def_userdef_theme_spaces_main(srna, SPACE_BUTS); + rna_def_userdef_theme_spaces_main(srna); prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -1534,7 +1583,7 @@ static void rna_def_userdef_theme_space_time(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Timeline", "Theme settings for the Timeline"); - rna_def_userdef_theme_spaces_main(srna, SPACE_TIME); + rna_def_userdef_theme_spaces_main(srna); prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -1560,7 +1609,7 @@ static void rna_def_userdef_theme_space_image(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Image Editor", "Theme settings for the Image Editor"); - rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE); + rna_def_userdef_theme_spaces_main(srna); rna_def_userdef_theme_spaces_vertex(srna); rna_def_userdef_theme_spaces_face(srna); @@ -1588,7 +1637,7 @@ static void rna_def_userdef_theme_space_seq(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Sequence Editor", "Theme settings for the Sequence Editor"); - rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE); + rna_def_userdef_theme_spaces_main(srna); prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -1680,7 +1729,8 @@ static void rna_def_userdef_theme_space_action(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme DopeSheet", "Theme settings for the DopeSheet"); - rna_def_userdef_theme_spaces_main(srna, SPACE_ACTION); + rna_def_userdef_theme_spaces_main(srna); + rna_def_userdef_theme_spaces_list_main(srna); prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -1766,7 +1816,8 @@ static void rna_def_userdef_theme_space_nla(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme NLA Editor", "Theme settings for the NLA Editor"); - rna_def_userdef_theme_spaces_main(srna, SPACE_NLA); + rna_def_userdef_theme_spaces_main(srna); + rna_def_userdef_theme_spaces_list_main(srna); prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -1855,7 +1906,7 @@ static void rna_def_userdef_theme_space_clip(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Clip Editor", "Theme settings for the Movie Clip Editor"); - rna_def_userdef_theme_spaces_main(srna, SPACE_CLIP); + rna_def_userdef_theme_spaces_main(srna); prop= RNA_def_property(srna, "marker_outline", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "marker_outline"); @@ -2110,6 +2161,9 @@ static void rna_def_userdef_dothemes(BlenderRNA *brna) rna_def_userdef_theme_ui_style(brna); rna_def_userdef_theme_ui(brna); + + rna_def_userdef_theme_space_generic(brna); + rna_def_userdef_theme_space_list_generic(brna); rna_def_userdef_theme_space_view3d(brna); rna_def_userdef_theme_space_graph(brna); |