Ticket #5293: MenuItemSelectedBackgroundColor_1.diff

File MenuItemSelectedBackgroundColor_1.diff, 1.2 KB (added by jscipione, 10 years ago)

Diff of just the selected menu item background color fix

  • src/kits/interface/ControlLook.cpp

    diff --git src/kits/interface/ControlLook.cpp src/kits/interface/ControlLook.cpp
    index a0d8a11..c21d287 100644
    BControlLook::DrawMenuItemBackground(BView* view, BRect& rect,  
    344344    if ((flags & B_ACTIVATED) != 0) {
    345345        topTint = 0.9;
    346346        bottomTint = 1.05;
    347         selectedColor = tint_color(base, 1.26);
     347        selectedColor = ui_color(B_MENU_SELECTED_BACKGROUND_COLOR);
    348348    } else if ((flags & B_DISABLED) != 0) {
    349349        topTint = 0.80;
    350350        bottomTint = 1.07;
  • src/kits/interface/MenuItem.cpp

    diff --git src/kits/interface/MenuItem.cpp src/kits/interface/MenuItem.cpp
    index 5d2dd98..91a8bf4 100644
    BMenuItem::Draw()  
    469469    // set high color
    470470    if (be_control_look != NULL) {
    471471        if (enabled) {
    472             fSuper->SetHighColor(tint_color(fSuper->LowColor(),
    473                 B_DARKEN_MAX_TINT));
     472            rgb_color low = fSuper->LowColor();
     473            if (low.red + low.green + low.blue > 128 * 3)
     474                fSuper->SetHighColor(tint_color(low, B_DARKEN_MAX_TINT));
     475            else
     476                fSuper->SetHighColor(tint_color(low, B_LIGHTEN_MAX_TINT));
    474477        } else {
    475478            fSuper->SetHighColor(tint_color(fSuper->LowColor(),
    476479                B_DISABLED_LABEL_TINT));