diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-10-14 12:16:46 +0400 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2014-10-14 12:17:06 +0400 |
commit | c08e7e1dc0366c485dbea5ef1209f2cdb616fbb3 (patch) | |
tree | ba3bc8286dc948d7a9bef7f6479df6bbc488b559 /source | |
parent | cd2295f93e11bb53696e5011b083b72d74cdf707 (diff) |
Fix T42209: Changing Node Editor header color also changes wire color
The nodes wire was using 'TH_HEADER' flag to get its color and thus would be in sync with the header. Now make it so it uses its 'own' flag (actually 'TH_SYNTAX_R', the only TH_SYNTAX_* which wasn't yet used by the nodes).
Also expose the setting to the user so it can be themified.
This fixes T42209
Reviewers: lukastoenne
Reviewed By: lukastoenne
Maniphest Tasks: T42209
Differential Revision: https://developer.blender.org/D827
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/include/UI_resources.h | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 6 |
4 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index 872bd32b75b..5b61e76f514 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -87,6 +87,7 @@ enum { TH_GRID, TH_WIRE, + TH_WIRE_INNER, TH_WIRE_EDIT, TH_SELECT, TH_ACTIVE, diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 0879f335c68..bcd85333709 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -271,6 +271,8 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo cp = ts->view_overlay; break; case TH_WIRE: cp = ts->wire; break; + case TH_WIRE_INNER: + cp = ts->syntaxr; break; case TH_WIRE_EDIT: cp = ts->wire_edit; break; case TH_LAMP: @@ -1104,6 +1106,7 @@ void ui_theme_init_default(void) /* space node, re-uses syntax and console color storage */ btheme->tnode = btheme->tv3d; + rgba_char_args_set(btheme->tnode.syntaxr, 115, 115, 115, 255); /* wire inner color */ rgba_char_args_set(btheme->tnode.edge_select, 255, 255, 255, 255); /* wire selected */ rgba_char_args_set(btheme->tnode.syntaxl, 155, 155, 155, 160); /* TH_NODE, backdrop */ rgba_char_args_set(btheme->tnode.syntaxn, 100, 100, 100, 255); /* in */ @@ -2444,6 +2447,7 @@ void init_userdef_do_versions(void) rgba_char_args_set_fl(btheme->tv3d.paint_curve_pivot, 1.0f, 0.5f, 0.5f, 0.5f); rgba_char_args_set_fl(btheme->tima.paint_curve_handle, 0.5f, 1.0f, 0.5f, 0.5f); rgba_char_args_set_fl(btheme->tima.paint_curve_pivot, 1.0f, 0.5f, 0.5f, 0.5f); + rgba_char_args_set(btheme->tnode.syntaxr, 115, 115, 115, 255); } } diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index df07d8bdfb1..5a3d4d6312a 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3444,7 +3444,7 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) { bool do_shaded = false; bool do_triple = false; - int th_col1 = TH_HEADER, th_col2 = TH_HEADER, th_col3 = TH_WIRE; + int th_col1 = TH_SYNTAX_R, th_col2 = TH_SYNTAX_R, th_col3 = TH_WIRE; if (link->fromsock == NULL && link->tosock == NULL) return; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index cfeac6ae947..3af48b2c0ca 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2034,6 +2034,12 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Wires", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop = RNA_def_property(srna, "wire_inner", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "syntaxr"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Wire Color", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop = RNA_def_property(srna, "wire_select", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "edge_select"); RNA_def_property_array(prop, 3); |