From 675807e2b6b29558367d49ab7f9f30e90c975fcb Mon Sep 17 00:00:00 2001 From: Red Mser Date: Tue, 15 Sep 2020 18:42:38 -0500 Subject: 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 --- release/datafiles/userdef/userdef_default_theme.c | 2 ++ release/scripts/presets/interface_theme/blender_light.xml | 3 +++ 2 files changed, 5 insertions(+) (limited to 'release') diff --git a/release/datafiles/userdef/userdef_default_theme.c b/release/datafiles/userdef/userdef_default_theme.c index 8cbb615491d..d3175a6fa56 100644 --- a/release/datafiles/userdef/userdef_default_theme.c +++ b/release/datafiles/userdef/userdef_default_theme.c @@ -812,6 +812,7 @@ const bTheme U_theme_default = { .sub_back = RGBA(0x0000003e), }, .shade2 = RGBA(0x7f707064), + .grid = RGBA(0x23232300), .wire = RGBA(0x808080ff), .select = RGBA(0xed5700ff), .active = RGBA(0xffffffff), @@ -924,6 +925,7 @@ const bTheme U_theme_default = { .back = RGBA(0x333333b3), .sub_back = RGBA(0x0000003e), }, + .grid = RGBA(0x424242ff), .strip = RGBA(0x0c0a0a80), .strip_select = RGBA(0xff8c00ff), .cframe = RGBA(0x5680c2ff), diff --git a/release/scripts/presets/interface_theme/blender_light.xml b/release/scripts/presets/interface_theme/blender_light.xml index 53e2571ae8c..299bd3e9bdb 100644 --- a/release/scripts/presets/interface_theme/blender_light.xml +++ b/release/scripts/presets/interface_theme/blender_light.xml @@ -713,6 +713,7 @@