diff options
author | Sv. Lockal <lockalsash@gmail.com> | 2013-12-17 22:02:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-12-17 22:03:30 +0400 |
commit | f034e69f0c3d247c5fb9343bceb7c8a249e43c90 (patch) | |
tree | bae129c9b99bc4a5d3b9fa7bb20578ef7252b89f /source/blender/editors/space_info/info_draw.c | |
parent | c5d7ea091fa5a291b270565e456612df1e37b50c (diff) |
UI: Theme Colors for Info space
Diffstat (limited to 'source/blender/editors/space_info/info_draw.c')
-rw-r--r-- | source/blender/editors/space_info/info_draw.c | 63 |
1 files changed, 27 insertions, 36 deletions
diff --git a/source/blender/editors/space_info/info_draw.c b/source/blender/editors/space_info/info_draw.c index a748c303b5d..6647a8ee946 100644 --- a/source/blender/editors/space_info/info_draw.c +++ b/source/blender/editors/space_info/info_draw.c @@ -67,45 +67,36 @@ static void info_report_color(unsigned char *fg, unsigned char *bg, Report *report, const short do_tint) { + int bg_id = TH_BACK, fg_id = TH_TEXT; + int shade = do_tint ? 0 : -6; + if (report->flag & SELECT) { - fg[0] = 255; fg[1] = 255; fg[2] = 255; - if (do_tint) { - bg[0] = 96; bg[1] = 128; bg[2] = 255; - } - else { - bg[0] = 90; bg[1] = 122; bg[2] = 249; - } + bg_id = TH_INFO_SELECTED; + fg_id = TH_INFO_SELECTED_TEXT; + } + else if (report->type & RPT_ERROR_ALL) { + bg_id = TH_INFO_ERROR; + fg_id = TH_INFO_ERROR_TEXT; + } + else if (report->type & RPT_WARNING_ALL) { + bg_id = TH_INFO_WARNING; + fg_id = TH_INFO_WARNING_TEXT; + } + else if (report->type & RPT_INFO_ALL) { + bg_id = TH_INFO_INFO; + fg_id = TH_INFO_INFO_TEXT; + } + else if (report->type & RPT_DEBUG_ALL) { + bg_id = TH_INFO_DEBUG; + fg_id = TH_INFO_DEBUG_TEXT; } else { - fg[0] = 0; fg[1] = 0; fg[2] = 0; - - if (report->type & RPT_ERROR_ALL) { - if (do_tint) { bg[0] = 220; bg[1] = 0; bg[2] = 0; } - else { bg[0] = 214; bg[1] = 0; bg[2] = 0; } - } - else if (report->type & RPT_WARNING_ALL) { - if (do_tint) { bg[0] = 220; bg[1] = 128; bg[2] = 96; } - else { bg[0] = 214; bg[1] = 122; bg[2] = 90; } - } -#if 0 // XXX: this looks like the selected color, so don't use this - else if (report->type & RPT_OPERATOR_ALL) { - if (do_tint) { bg[0] = 96; bg[1] = 128; bg[2] = 255; } - else { bg[0] = 90; bg[1] = 122; bg[2] = 249; } - } -#endif - else if (report->type & RPT_INFO_ALL) { - if (do_tint) { bg[0] = 0; bg[1] = 170; bg[2] = 0; } - else { bg[0] = 0; bg[1] = 164; bg[2] = 0; } - } - else if (report->type & RPT_DEBUG_ALL) { - if (do_tint) { bg[0] = 196; bg[1] = 196; bg[2] = 196; } - else { bg[0] = 190; bg[1] = 190; bg[2] = 190; } - } - else { - if (do_tint) { bg[0] = 120; bg[1] = 120; bg[2] = 120; } - else { bg[0] = 114; bg[1] = 114; bg[2] = 114; } - } + bg_id = TH_BACK; + fg_id = TH_TEXT; } + + UI_GetThemeColorShade3ubv(bg_id, shade, bg); + UI_GetThemeColor3ubv(fg_id, fg); } /* reports! */ @@ -148,7 +139,7 @@ static int report_textview_begin(TextViewContext *tvc) /* iterator */ tvc->iter = reports->list.last; - glClearColor(120.0 / 255.0, 120.0 / 255.0, 120.0 / 255.0, 1.0); + UI_ThemeClearColor(TH_BACK); glClear(GL_COLOR_BUFFER_BIT); #ifdef USE_INFO_NEWLINE |