Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRed Mser <RedMser>2020-09-16 02:42:38 +0300
committerHans Goudey <h.goudey@me.com>2020-09-16 02:42:38 +0300
commit675807e2b6b29558367d49ab7f9f30e90c975fcb (patch)
treeb06dd846a129ff2493d44b888e8786d5da2b47fc /source/blender/makesrna/intern/rna_userdef.c
parent1858535a105c306282d95d1894f4f8dc088d17e4 (diff)
UI: Add grid-related theme options
This commit makes grid theming more consistent and capable by adding some new theme colors related to grid rendering. - Add grid theme color for node editor. `UI_view2d_multi_grid_draw` is called with TH_GRID instead of a shaded `TH_BACK`. Also color-blend `TH_NODE_GROUP`. - Make the movie clip editor's clip preview grid respect grid theme color (`ED_region_grid_draw` uses color-blended `TH_GRID`). - Add versioning code to allow fixing existing themes (the resulting themes should visually look the same as before) These changes did cause some inconsistencies in the movie clip editor, even after adjusting the themes accordingly: 1. The alpha slider of the grid color affects the background and not the grid lines themselves. 2. The grids used by graph and dopesheet mode could already be themed in the past. Now that the clip preview's grid can also be themed, two different modes share the same theme color. Differential Revision: https://developer.blender.org/D8699
Diffstat (limited to 'source/blender/makesrna/intern/rna_userdef.c')
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 118a512caf9..7986e129067 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -2795,6 +2795,11 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
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);
+ RNA_def_property_ui_text(prop, "Grid", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
+
prop = RNA_def_property(srna, "node_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "select");
RNA_def_property_array(prop, 3);
@@ -2982,6 +2987,12 @@ static void rna_def_userdef_theme_space_image(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Theme Image Editor", "Theme settings for the Image Editor");
rna_def_userdef_theme_spaces_main(srna);
+
+ prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_array(prop, 4);
+ RNA_def_property_ui_text(prop, "Grid", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
+
rna_def_userdef_theme_spaces_vertex(srna);
rna_def_userdef_theme_spaces_face(srna);
@@ -3066,11 +3077,6 @@ static void rna_def_userdef_theme_space_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Metadata Text", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
- prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
- RNA_def_property_array(prop, 4);
- RNA_def_property_ui_text(prop, "Grid", "");
- RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
-
rna_def_userdef_theme_spaces_curves(srna, false, false, false, true);
rna_def_userdef_theme_spaces_paint_curves(srna);
@@ -3656,7 +3662,7 @@ static void rna_def_userdef_theme_space_clip(BlenderRNA *brna)
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);
+ RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Grid", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");