From 7fc0053c27e5e9ba3cc946898c7c11a8545f2777 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 2 Jun 2020 15:04:46 -0400 Subject: UI: Fix T77173: Report Background Colors for 2.83 Release This is a temporary solution for T77173 for the 2.83 release. D7203 provides a more long term solution for future releases. This adds theme colors for the three report backgrounds, setting them to the color used in 2.82. A separate commit in the addons repository will follow for changes to the bundled themes. Differential Revision: https://developer.blender.org/D7908 --- source/blender/blenkernel/BKE_blender_version.h | 2 +- source/blender/blenloader/intern/versioning_userdef.c | 6 ++++++ source/blender/editors/include/UI_resources.h | 3 +++ source/blender/editors/interface/resources.c | 9 +++++++++ source/blender/editors/space_info/info_ops.c | 6 +++--- source/blender/makesdna/DNA_userdef_types.h | 2 ++ source/blender/makesrna/intern/rna_userdef.c | 15 +++++++++++++++ 7 files changed, 39 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 3a07e9133d3..f1b274a2002 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -36,7 +36,7 @@ /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 17 +#define BLENDER_FILE_SUBVERSION 18 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and show a warning if the file diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index a426e49dd77..abc2e00e9e3 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -216,6 +216,12 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme) btheme->tui.transparent_checker_size = U_theme_default.tui.transparent_checker_size; } + if (!USER_VERSION_ATLEAST(283, 18)) { + FROM_DEFAULT_V4_UCHAR(space_info.info_report_error); + FROM_DEFAULT_V4_UCHAR(space_info.info_report_warning); + FROM_DEFAULT_V4_UCHAR(space_info.info_report_info); + } + /** * Versioning code until next subversion bump goes here. * diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index b0995250979..9b09f3b7519 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -340,6 +340,9 @@ typedef enum ThemeColorID { TH_INFO_OPERATOR, TH_INFO_OPERATOR_TEXT, TH_VIEW_OVERLAY, + TH_INFO_REPORT_ERROR, + TH_INFO_REPORT_WARNING, + TH_INFO_REPORT_INFO, TH_V3D_CLIPPING_BORDER, diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 01c9716ec86..ac7d8783123 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1013,6 +1013,15 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid) case TH_INFO_OPERATOR_TEXT: cp = ts->info_operator_text; break; + case TH_INFO_REPORT_ERROR: + cp = ts->info_report_error; + break; + case TH_INFO_REPORT_WARNING: + cp = ts->info_report_warning; + break; + case TH_INFO_REPORT_INFO: + cp = ts->info_report_info; + break; case TH_V3D_CLIPPING_BORDER: cp = ts->clipping_border_3d; break; diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index 30f36509b41..2e639879447 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -568,13 +568,13 @@ static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), co /* set target color based on report type */ if (report->type & RPT_ERROR_ALL) { - UI_GetThemeColorType3fv(TH_INFO_ERROR, SPACE_INFO, target_col); + UI_GetThemeColorType3fv(TH_INFO_REPORT_ERROR, SPACE_INFO, target_col); } else if (report->type & RPT_WARNING_ALL) { - UI_GetThemeColorType3fv(TH_INFO_WARNING, SPACE_INFO, target_col); + UI_GetThemeColorType3fv(TH_INFO_REPORT_WARNING, SPACE_INFO, target_col); } else if (report->type & RPT_INFO_ALL) { - UI_GetThemeColorType3fv(TH_INFO_INFO, SPACE_INFO, target_col); + UI_GetThemeColorType3fv(TH_INFO_REPORT_INFO, SPACE_INFO, target_col); } target_col[3] = 0.65f; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 7a09059e344..87a311bd336 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -422,6 +422,8 @@ typedef struct ThemeSpace { unsigned char info_debug[4], info_debug_text[4]; unsigned char info_property[4], info_property_text[4]; unsigned char info_operator[4], info_operator_text[4]; + unsigned char info_report_error[4], info_report_warning[4], info_report_info[4]; + char _pad[4]; unsigned char paint_curve_pivot[4]; unsigned char paint_curve_handle[4]; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index c08a95d7e16..dbaed873faa 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2669,6 +2669,21 @@ static void rna_def_userdef_theme_space_info(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Operator Icon Foreground", "Foreground color of Operator icon"); RNA_def_property_update(prop, 0, "rna_userdef_theme_update"); + + prop = RNA_def_property(srna, "info_report_error", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Error Banner Background", ""); + RNA_def_property_update(prop, 0, "rna_userdef_theme_update"); + + prop = RNA_def_property(srna, "info_report_warning", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Warning Banner Background", ""); + RNA_def_property_update(prop, 0, "rna_userdef_theme_update"); + + prop = RNA_def_property(srna, "info_report_info", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Info Banner Background", ""); + RNA_def_property_update(prop, 0, "rna_userdef_theme_update"); } static void rna_def_userdef_theme_space_text(BlenderRNA *brna) -- cgit v1.2.3