Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarley Acheson <harley.acheson@gmail.com>2021-02-08 19:19:23 +0300
committerHarley Acheson <harley.acheson@gmail.com>2021-02-08 19:19:23 +0300
commit694bc4d040a8bf762284598e98bf0575549a3e1c (patch)
tree0e4d95baac18731e0ab5a135acf5eff6f8b53432 /source/blender/editors/space_info
parent21a2b975b8192c2714625c8f5e98a08fde796ba7 (diff)
Fix for T84038: Improved Report Warnings
Improved contrast for Status Bar report warning messages. Differential Revision: https://developer.blender.org/D10242 Reviewed by Hans Goudey
Diffstat (limited to 'source/blender/editors/space_info')
-rw-r--r--source/blender/editors/space_info/info_draw.c46
-rw-r--r--source/blender/editors/space_info/info_ops.c10
-rw-r--r--source/blender/editors/space_info/textview.c2
3 files changed, 8 insertions, 50 deletions
diff --git a/source/blender/editors/space_info/info_draw.c b/source/blender/editors/space_info/info_draw.c
index dc926587367..f63a5530555 100644
--- a/source/blender/editors/space_info/info_draw.c
+++ b/source/blender/editors/space_info/info_draw.c
@@ -56,47 +56,11 @@ static enum eTextViewContext_LineFlag report_line_data(TextViewContext *tvc,
int shade = (tvc->iter_tmp % 2) ? 4 : -4;
UI_GetThemeColorShade4ubv(bg_id, shade, bg);
- /* Icon color and background depend of report type. */
+ /* Don't show icon on subsequent rows of multirow report. */
+ *r_icon = (tvc->iter_char_begin != 0) ? ICON_NONE : UI_icon_from_report_type(report->type);
- int icon_fg_id;
- int icon_bg_id;
-
- if (tvc->iter_char_begin != 0) {
- *r_icon = ICON_NONE;
- }
- else if (report->type & RPT_ERROR_ALL) {
- icon_fg_id = TH_INFO_ERROR_TEXT;
- icon_bg_id = TH_INFO_ERROR;
- *r_icon = ICON_CANCEL;
- }
- else if (report->type & RPT_WARNING_ALL) {
- icon_fg_id = TH_INFO_WARNING_TEXT;
- icon_bg_id = TH_INFO_WARNING;
- *r_icon = ICON_ERROR;
- }
- else if (report->type & RPT_INFO_ALL) {
- icon_fg_id = TH_INFO_INFO_TEXT;
- icon_bg_id = TH_INFO_INFO;
- *r_icon = ICON_INFO;
- }
- else if (report->type & RPT_DEBUG_ALL) {
- icon_fg_id = TH_INFO_DEBUG_TEXT;
- icon_bg_id = TH_INFO_DEBUG;
- *r_icon = ICON_SYSTEM;
- }
- else if (report->type & RPT_PROPERTY) {
- icon_fg_id = TH_INFO_PROPERTY_TEXT;
- icon_bg_id = TH_INFO_PROPERTY;
- *r_icon = ICON_OPTIONS;
- }
- else if (report->type & RPT_OPERATOR) {
- icon_fg_id = TH_INFO_OPERATOR_TEXT;
- icon_bg_id = TH_INFO_OPERATOR;
- *r_icon = ICON_CHECKMARK;
- }
- else {
- *r_icon = ICON_NONE;
- }
+ int icon_fg_id = UI_text_colorid_from_report_type(report->type);
+ int icon_bg_id = UI_icon_colorid_from_report_type(report->type);
if (report->flag & SELECT) {
icon_fg_id = TH_INFO_SELECTED;
@@ -105,6 +69,8 @@ static enum eTextViewContext_LineFlag report_line_data(TextViewContext *tvc,
if (*r_icon != ICON_NONE) {
UI_GetThemeColor4ubv(icon_fg_id, r_icon_fg);
+ /* This theme color is RGB only, so set alpha. */
+ r_icon_fg[3] = 255;
UI_GetThemeColor4ubv(icon_bg_id, r_icon_bg);
return TVC_LINE_FG | TVC_LINE_BG | TVC_LINE_ICON | TVC_LINE_ICON_FG | TVC_LINE_ICON_BG;
}
diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c
index 3bd23eab836..b6d47b74fdc 100644
--- a/source/blender/editors/space_info/info_ops.c
+++ b/source/blender/editors/space_info/info_ops.c
@@ -567,15 +567,7 @@ 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);
- }
- else if (report->type & RPT_WARNING_ALL) {
- UI_GetThemeColorType3fv(TH_INFO_WARNING, SPACE_INFO, target_col);
- }
- else if (report->type & RPT_INFO_ALL) {
- UI_GetThemeColorType3fv(TH_INFO_INFO, SPACE_INFO, target_col);
- }
+ UI_GetThemeColorType3fv(UI_icon_colorid_from_report_type(report->type), SPACE_INFO, target_col);
target_col[3] = 0.65f;
if (rti->widthfac == 0.0f) {
diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c
index ef5d9c0aab0..aef59e89325 100644
--- a/source/blender/editors/space_info/textview.c
+++ b/source/blender/editors/space_info/textview.c
@@ -225,7 +225,7 @@ static bool textview_draw_string(TextViewDrawState *tds,
rgba_uchar_to_float(col, icon_bg);
UI_draw_roundbox_corner_set(UI_CNR_ALL);
- UI_draw_roundbox_aa(
+ UI_draw_roundbox_4fv(
&(const rctf){
.xmin = hpadding,
.xmax = bg_size + hpadding,