Fix T83988: Active modifier outline uses search theme color

The outline for the active modifier was abusing the property search
match theme color, as noted in a comment. This commit adds a new
theme color in RNA specifically for the active modifier outline.
This commit is contained in:
Hans Goudey
2021-01-28 16:16:24 -06:00
parent 2f60e5d1b5
commit 71cb6923f5
5 changed files with 17 additions and 9 deletions

View File

@@ -287,6 +287,7 @@ const bTheme U_theme_default = {
.outline_width = 1, .outline_width = 1,
.facedot_size = 4, .facedot_size = 4,
.match = RGBA(0x5680c2ff), .match = RGBA(0x5680c2ff),
.active = RGBA(0x5680c2ff),
}, },
.space_view3d = { .space_view3d = {
.back = RGBA(0x393939ff), .back = RGBA(0x393939ff),

View File

@@ -855,6 +855,7 @@
<properties> <properties>
<ThemeProperties <ThemeProperties
match="#5680c2" match="#5680c2"
active_modifier="#5680c2ff"
> >
<space> <space>
<ThemeSpaceGeneric <ThemeSpaceGeneric

View File

@@ -272,6 +272,7 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
*/ */
{ {
/* Keep this block, even when empty. */ /* Keep this block, even when empty. */
FROM_DEFAULT_V4_UCHAR(space_properties.active);
} }
#undef FROM_DEFAULT_V4_UCHAR #undef FROM_DEFAULT_V4_UCHAR

View File

@@ -1119,16 +1119,15 @@ static void panel_draw_highlight_border(const Panel *panel,
radius = 0.0f; radius = 0.0f;
} }
/* Abuse the property search theme color for now. */
float color[4]; float color[4];
UI_GetThemeColor4fv(TH_MATCH, color); UI_GetThemeColor4fv(TH_SELECT_ACTIVE, color);
UI_draw_roundbox_aa(false, UI_draw_roundbox_4fv(false,
rect->xmin, rect->xmin,
UI_panel_is_closed(panel) ? header_rect->ymin : rect->ymin, UI_panel_is_closed(panel) ? header_rect->ymin : rect->ymin,
rect->xmax, rect->xmax,
header_rect->ymax, header_rect->ymax,
radius, radius,
color); color);
} }
static void panel_draw_aligned_widgets(const uiStyle *style, static void panel_draw_aligned_widgets(const uiStyle *style,

View File

@@ -3005,6 +3005,12 @@ static void rna_def_userdef_theme_space_buts(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Search Match", ""); RNA_def_property_ui_text(prop, "Search Match", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update"); RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
prop = RNA_def_property(srna, "active_modifier", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "active");
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Active Modifier Outline", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
rna_def_userdef_theme_spaces_main(srna); rna_def_userdef_theme_spaces_main(srna);
} }