Show
Ignore:
Timestamp:
10/28/07 23:29:14 (1 year ago)
Author:
daboo
Message:

Tweak the look of calendar events.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Mulberry/branches/v4.1d1/MacOS/Sources/Application/Calendar/Calendar_View/ToDo_View/CToDoItem.cp

    r97 r111  
    3737const float cCheckboxHeight = 12.0; 
    3838const float cTextTopOffset = 2.0; 
     39 
     40const float body_transparency = 1.0; 
     41const float line_transparency = 1.0; 
     42const float text_transparency = 1.0; 
    3943 
    4044// --------------------------------------------------------------------------- 
     
    338342        float green = CGUtils::GetCGGreen(mColour); 
    339343        float blue = CGUtils::GetCGBlue(mColour); 
    340         if (mIsSelected) 
    341         { 
    342                 CGUtils::UnflattenColours(red, green, blue); 
     344        if (!mIsSelected) 
     345        { 
     346                CGUtils::LightenColours(red, green, blue, true); 
    343347        } 
    344348 
     
    366370                if (mIsSelected) 
    367371                { 
    368                         CGUtils::UnflattenColours(red, green, blue); 
    369372                        ::CGContextSetRGBFillColor(inContext, red, green, blue, 1.0); 
    370373                } 
    371374                else 
    372375                { 
    373                         ::CGContextSetRGBFillColor(inContext, red, green, blue, 1.0); 
     376                        CGUtils::LightenColours(red, green, blue, true); 
     377                        ::CGContextSetRGBFillColor(inContext, red, green, blue, body_transparency); 
    374378                } 
    375379                 
     
    393397        box.top += cTextTopOffset; 
    394398        box.bottom = box.top + cItemHeight / 2.0; 
    395         ::CGContextSetGrayFillColor(inContext, mIsSelected ? 1.0 : 0.0, 1.0); 
     399        float red = CGUtils::GetCGRed(mColour); 
     400        float green = CGUtils::GetCGGreen(mColour); 
     401        float blue = CGUtils::GetCGBlue(mColour); 
     402        if (mIsSelected) 
     403        { 
     404                ::CGContextSetGrayFillColor(inContext, (red + green + blue > 2.5) ? 0.0 : 1.0, 1.0); 
     405        } 
     406        else 
     407        { 
     408                CGUtils::DarkenColours(red, green, blue); 
     409                ::CGContextSetRGBFillColor(inContext, red, green, blue, text_transparency); 
     410        } 
    396411        MyCFString trunc1(mSummary, kCFStringEncodingUTF8); 
    397412        ::TruncateThemeText(trunc1, kThemeSmallSystemFont, kThemeStateActive, box.right - box.left, truncEnd, NULL);