Ticket #12569: Tracker-Column-Title-Colors.patch

File Tracker-Column-Title-Colors.patch, 3.0 KB (added by looncraz, 9 years ago)
  • src/kits/tracker/TitleView.cpp

    From ff29be86b3323963d95e2c6442afff116d08de8a Mon Sep 17 00:00:00 2001
    From: looncraz <looncraz@looncraz.net>
    Date: Wed, 6 Jan 2016 12:44:41 -0600
    Subject: [PATCH] Tracker Column Title Colors
    
    Repair regression where low color for text drawing was not set properly.
    Do not use tinted color for default color state.
    
    Prior to this, the hinting font would not respond to being pressed and the column title
    background was the wrong color initially, but correct after resizing (but then wrong again
    after a redraw on exposure).
    
    In addition, the initial tint values used for the view color were unused, so I removed them.
    ---
     src/kits/tracker/TitleView.cpp | 20 ++++++++++----------
     1 file changed, 10 insertions(+), 10 deletions(-)
    
    diff --git a/src/kits/tracker/TitleView.cpp b/src/kits/tracker/TitleView.cpp
    index 9314bca..22b027d 100644
    a b All rights reserved.  
    5656
    5757#define APP_SERVER_CLEARS_BACKGROUND 1
    5858
    59 
    6059static void
    6160_DrawLine(BPoseView* view, BPoint from, BPoint to)
    6261{
    BTitleView::BTitleView(BPoseView* view)  
    101100    fPreviousLeftClickTime(0),
    102101    fTrackingState(NULL)
    103102{
    104     SetHighUIColor(B_PANEL_BACKGROUND_COLOR, 0.88f);
    105     SetLowUIColor(B_PANEL_BACKGROUND_COLOR, 0.88f);
     103    SetHighUIColor(B_PANEL_BACKGROUND_COLOR);
     104    SetLowUIColor(B_PANEL_BACKGROUND_COLOR);
    106105#if APP_SERVER_CLEARS_BACKGROUND
    107     SetViewUIColor(B_PANEL_BACKGROUND_COLOR, 0.88f);
     106    SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
    108107#else
    109108    SetViewColor(B_TRANSPARENT_COLOR);
    110109#endif
    BTitleView::Draw(BRect /*updateRect*/, bool useOffscreen, bool updateOnly,  
    229228    view->StrokeLine(bounds.LeftBottom(), bounds.RightBottom());
    230229    bounds.bottom--;
    231230
    232     be_control_look->DrawButtonBackground(view, bounds, bounds, HighColor(), 0,
     231    rgb_color baseColor = ui_color(B_PANEL_BACKGROUND_COLOR);
     232    be_control_look->DrawButtonBackground(view, bounds, bounds, baseColor, 0,
    233233        BControlLook::B_TOP_BORDER | BControlLook::B_BOTTOM_BORDER);
    234234
    235235    int32 count = fTitleList.CountItems();
    BColumnTitle::Draw(BView* view, bool pressed)  
    470470    font_height height;
    471471    view->GetFontHeight(&height);
    472472    BPoint loc(0, bounds.top + ceilf(height.ascent) + 2);
     473    rgb_color baseColor = ui_color(B_PANEL_BACKGROUND_COLOR);
    473474
    474475    if (pressed) {
    475476        bounds.bottom--;
    476477        BRect rect(bounds);
    477478        rect.right--;
    478         rgb_color base = tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
    479             B_DARKEN_1_TINT);
     479        baseColor = tint_color(baseColor, B_DARKEN_1_TINT);
    480480
    481         be_control_look->DrawButtonBackground(view, rect, rect, base, 0,
     481        be_control_look->DrawButtonBackground(view, rect, rect, baseColor, 0,
    482482            BControlLook::B_TOP_BORDER | BControlLook::B_BOTTOM_BORDER);
    483483    }
    484484
    BColumnTitle::Draw(BView* view, bool pressed)  
    503503            break;
    504504    }
    505505
    506     view->SetHighUIColor(B_PANEL_TEXT_COLOR, 0.8f);
    507     view->SetLowUIColor(B_PANEL_BACKGROUND_COLOR, pressed ? 1.1 : 1.0);
     506    view->SetHighUIColor(B_PANEL_TEXT_COLOR, pressed ? B_DARKEN_1_TINT : 1.0f);
     507    view->SetLowColor(baseColor);
    508508    view->DrawString(titleString.String(), loc);
    509509
    510510    // show sort columns