diff options
author | Red Mser <RedMser> | 2020-09-16 02:42:38 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-09-16 02:42:38 +0300 |
commit | 675807e2b6b29558367d49ab7f9f30e90c975fcb (patch) | |
tree | b06dd846a129ff2493d44b888e8786d5da2b47fc /source/blender/editors/space_node/node_draw.c | |
parent | 1858535a105c306282d95d1894f4f8dc088d17e4 (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/editors/space_node/node_draw.c')
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index fc4685929d3..0c5ec1bf80e 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -1803,7 +1803,7 @@ void drawnodespace(const bContext *C, ARegion *region) /* grid, uses theme color based on node path depth */ UI_view2d_multi_grid_draw(v2d, - (depth > 0 ? TH_NODE_GROUP : TH_BACK), + (depth > 0 ? TH_NODE_GROUP : TH_GRID), ED_node_grid_size(), NODE_GRID_STEPS, grid_levels); @@ -1847,7 +1847,7 @@ void drawnodespace(const bContext *C, ARegion *region) } else { /* default grid */ - UI_view2d_multi_grid_draw(v2d, TH_BACK, ED_node_grid_size(), NODE_GRID_STEPS, grid_levels); + UI_view2d_multi_grid_draw(v2d, TH_GRID, ED_node_grid_size(), NODE_GRID_STEPS, grid_levels); /* backdrop */ draw_nodespace_back_pix(C, region, snode, NODE_INSTANCE_KEY_NONE); |