Ticket #9129: 0001-Terminal-Use-brighter-colors-instead-of-bold.patch

File 0001-Terminal-Use-brighter-colors-instead-of-bold.patch, 1.6 KB (added by js, 11 years ago)
  • src/apps/terminal/TermView.cpp

    From 4d163227c753f0ab791808622e6b714ba3c0d35d Mon Sep 17 00:00:00 2001
    From: Jonathan Schleifer <js@webkeks.org>
    Date: Thu, 8 Nov 2012 21:59:54 +0100
    Subject: [PATCH] Terminal: Use brighter colors instead of bold.
    
    ---
     src/apps/terminal/TermView.cpp |   31 ++++++++++++++++++++++---------
     1 file changed, 22 insertions(+), 9 deletions(-)
    
    diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp
    index 7e7c089..0870b5c 100644
    a b TermView::_DrawLinePart(int32 x1, int32 y1, uint32 attr, char *buf,  
    11721172
    11731173    inView->SetHighColor(rgb_fore);
    11741174
    1175     // Draw character.
    1176     inView->MovePenTo(x1, y1 + fFontAscent);
    1177     inView->DrawString((char *) buf);
    1178 
    1179     // bold attribute.
    11801175    if (IS_BOLD(attr)) {
    1181         inView->MovePenTo(x1 + 1, y1 + fFontAscent);
     1176#define BRIGHT_ADD 64
     1177#define SATTURATED_ADD(var, add)    \
     1178    do {                            \
     1179        if (255 - var >= add)       \
     1180            var += add;             \
     1181        else                        \
     1182            var = 255;              \
     1183    } while (0)
     1184
     1185        rgb_color bright = rgb_fore;
     1186
     1187        SATTURATED_ADD(bright.red, BRIGHT_ADD);
     1188        SATTURATED_ADD(bright.green, BRIGHT_ADD);
     1189        SATTURATED_ADD(bright.blue, BRIGHT_ADD);
    11821190
    1183         inView->SetDrawingMode(B_OP_OVER);
    1184         inView->DrawString((char *)buf);
    1185         inView->SetDrawingMode(B_OP_COPY);
     1191        inView->SetHighColor(bright);
     1192
     1193#undef BRIGHT_ADD
     1194#undef SATTURATED_ADD
    11861195    }
    11871196
     1197    // Draw character.
     1198    inView->MovePenTo(x1, y1 + fFontAscent);
     1199    inView->DrawString((char *) buf);
     1200
    11881201    // underline attribute
    11891202    if (IS_UNDER(attr)) {
    11901203        inView->MovePenTo(x1, y1 + fFontAscent);