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/info_draw.c
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/info_draw.c')
-rw-r--r--source/blender/editors/space_info/info_draw.c46
1 files changed, 6 insertions, 40 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;
}