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
This commit is contained in:
Lukas Tönne 2014-10-14 10:16:46 +02:00
parent cd2295f93e
commit c08e7e1dc0
Notes: blender-bot 2023-12-22 20:14:11 +01:00
Referenced by issue #42209, Changing Node Editor header color also changes wire color
4 changed files with 12 additions and 1 deletions

View File

@ -87,6 +87,7 @@ enum {
TH_GRID,
TH_WIRE,
TH_WIRE_INNER,
TH_WIRE_EDIT,
TH_SELECT,
TH_ACTIVE,

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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);