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/blenloader
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/blenloader')
-rw-r--r--source/blender/blenloader/intern/versioning_userdef.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index d53959a1949..3cc2372a2b0 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -241,6 +241,13 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
}
FROM_DEFAULT_V4_UCHAR(space_properties.match);
+
+ /* New grid theme color defaults are the same as the existing background colors,
+ * so they are copied to limit disruption. */
+ copy_v3_v3_uchar(btheme->space_clip.grid, btheme->space_clip.back);
+ btheme->space_clip.grid[3] = 255.0f;
+
+ copy_v3_v3_uchar(btheme->space_node.grid, btheme->space_node.back);
}
#undef FROM_DEFAULT_V4_UCHAR