Ticket #10840: 0001-Use-user-color-for-selected-listItem-in-FileTypes-Me.patch

File 0001-Use-user-color-for-selected-listItem-in-FileTypes-Me.patch, 3.5 KB (added by Janus, 5 years ago)
  • src/preferences/filetypes/MimeTypeListView.cpp

    From d4b907d7d6f512c6ff20e3555f612195eeecedc6 Mon Sep 17 00:00:00 2001
    From: Janus <janus2@ymail.com>
    Date: Wed, 18 Mar 2015 20:55:38 +0000
    Subject: [PATCH] Use user color for selected listItem in FileTypes, Media,
     Printers
    
    ---
     src/preferences/filetypes/MimeTypeListView.cpp | 5 +----
     src/preferences/media/MediaListItem.cpp        | 6 ++----
     src/preferences/printers/JobListView.cpp       | 2 +-
     src/preferences/printers/PrinterListView.cpp   | 2 +-
     4 files changed, 5 insertions(+), 10 deletions(-)
    
    diff --git a/src/preferences/filetypes/MimeTypeListView.cpp b/src/preferences/filetypes/MimeTypeListView.cpp
    index 4cd5fca..32b2870 100644
    a b MimeTypeItem::DrawItem(BView* owner, BRect frame, bool complete)  
    8181    }
    8282
    8383    if (fShowIcon) {
    84         rgb_color highColor = owner->HighColor();
    8584        rgb_color lowColor = owner->LowColor();
    8685
    8786        if (IsSelected() || complete) {
    8887            if (IsSelected())
    89                 owner->SetLowColor(tint_color(lowColor, B_DARKEN_2_TINT));
     88                owner->SetLowColor(ui_color(B_LIST_SELECTED_BACKGROUND_COLOR));
    9089
    9190            owner->FillRect(rect, B_SOLID_LOW);
    9291        }
    MimeTypeItem::DrawItem(BView* owner, BRect frame, bool complete)  
    112111        owner->SetDrawingMode(B_OP_COPY);
    113112
    114113        owner->MovePenTo(rect.left + B_MINI_ICON + 8.0f, frame.top + fBaselineOffset);
    115         owner->SetHighColor(0, 0, 0);
    116114        owner->DrawString(Text());
    117115
    118         owner->SetHighColor(highColor);
    119116        owner->SetLowColor(lowColor);
    120117    } else
    121118        BStringItem::DrawItem(owner, rect, complete);
  • src/preferences/media/MediaListItem.cpp

    diff --git a/src/preferences/media/MediaListItem.cpp b/src/preferences/media/MediaListItem.cpp
    index e642384..a89afc2 100644
    a b struct MediaListItem::Renderer {  
    7676    {
    7777        const rgb_color lowColor = onto->LowColor();
    7878        const rgb_color highColor = onto->HighColor();
    79         const rgb_color kBlack = {0, 0, 0, 255};
    8079
    8180        if (fSelected || complete) {
    8281            if (fSelected)
    83                 onto->SetLowColor(tint_color(lowColor, B_DARKEN_2_TINT));
     82                onto->SetLowColor(ui_color(B_LIST_SELECTED_BACKGROUND_COLOR));
    8483            onto->FillRect(frame, B_SOLID_LOW);
    8584        }
    8685
    struct MediaListItem::Renderer {  
    102101            frame.left = iconFrame.right + 1;
    103102        }
    104103
    105         onto->SetDrawingMode(B_OP_COPY);
    106         onto->SetHighColor(kBlack);
     104        onto->SetDrawingMode(B_OP_COPY);;
    107105
    108106        BFont font = be_plain_font;
    109107        font_height fontInfo;
  • src/preferences/printers/JobListView.cpp

    diff --git a/src/preferences/printers/JobListView.cpp b/src/preferences/printers/JobListView.cpp
    index ff371d9..d634dbc 100644
    a b JobItem::DrawItem(BView *owner, BRect, bool complete)  
    277277        rgb_color oldHighColor = owner->HighColor();
    278278
    279279        if (IsSelected())
    280             color = tint_color(color, B_HIGHLIGHT_BACKGROUND_TINT);
     280            color = ui_color(B_LIST_SELECTED_BACKGROUND_COLOR);
    281281
    282282        owner->SetViewColor(color);
    283283        owner->SetHighColor(color);
  • src/preferences/printers/PrinterListView.cpp

    diff --git a/src/preferences/printers/PrinterListView.cpp b/src/preferences/printers/PrinterListView.cpp
    index 1c7deaa..f46e671 100644
    a b PrinterItem::DrawItem(BView *owner, BRect /*bounds*/, bool complete)  
    389389    rgb_color oldHighColor = owner->HighColor();
    390390
    391391    if (IsSelected())
    392         color = tint_color(color, B_HIGHLIGHT_BACKGROUND_TINT);
     392        color = ui_color(B_LIST_SELECTED_BACKGROUND_COLOR);
    393393
    394394    owner->SetViewColor(color);
    395395    owner->SetLowColor(color);