Commit: 9e88892f8f8a6dfa6092d87f0080f747233142e9
Author: Pablo Vazquez
Date:   Mon Jun 25 18:57:47 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB9e88892f8f8a6dfa6092d87f0080f747233142e9

UI: Use background color for reports

At the moment it's using a hardcoded gray color that conflicts with
themes using gray for the header text. Instead use a slightly brighter
background color to make it stand, yet still use a theme setting.

===================================================================

M       source/blender/editors/interface/interface_templates.c

===================================================================

diff --git a/source/blender/editors/interface/interface_templates.c 
b/source/blender/editors/interface/interface_templates.c
index 6ddecd169d9..61cb0cda8c8 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -4262,18 +4262,18 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext 
*C)
 
        /* make a box around the report to make it stand out */
        UI_block_align_begin(block);
-       but = uiDefBut(block, UI_BTYPE_ROUNDBOX, 0, "", 0, 0, UI_UNIT_X + 10, 
UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
+       but = uiDefBut(block, UI_BTYPE_ROUNDBOX, 0, "", 0, 0, UI_UNIT_X + 5, 
UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
        /* set the report's bg color in but->col - UI_BTYPE_ROUNDBOX feature */
        rgb_float_to_uchar(but->col, rti->col);
        but->col[3] = 255;
 
-       but = uiDefBut(block, UI_BTYPE_ROUNDBOX, 0, "", UI_UNIT_X + 10, 0, 
UI_UNIT_X + width, UI_UNIT_Y,
+       but = uiDefBut(block, UI_BTYPE_ROUNDBOX, 0, "", UI_UNIT_X + 5, 0, 
UI_UNIT_X + width, UI_UNIT_Y,
                       NULL, 0.0f, 0.0f, 0, 0, "");
-       but->col[0] = but->col[1] = but->col[2] = 
unit_float_to_uchar_clamp(rti->grayscale);
-       but->col[3] = 255;
 
        UI_block_align_end(block);
 
+       UI_GetThemeColorShade3ubv(TH_BACK, 20, but->col);
+       but->col[3] = 255;
 
        /* icon and report message on top */
        icon = UI_icon_from_report_type(report->type);
@@ -4291,7 +4291,7 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext 
*C)
 
        UI_block_emboss_set(block, UI_EMBOSS);
 
-       uiDefBut(block, UI_BTYPE_LABEL, 0, report->message, UI_UNIT_X + 10, 0, 
UI_UNIT_X + width, UI_UNIT_Y,
+       uiDefBut(block, UI_BTYPE_LABEL, 0, report->message, UI_UNIT_X + 5, 0, 
UI_UNIT_X + width, UI_UNIT_Y,
                 NULL, 0.0f, 0.0f, 0, 0, "");
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to