Ticket #12589: BButton-Default-Appearance.patch

File BButton-Default-Appearance.patch, 2.3 KB (added by looncraz, 9 years ago)
  • src/kits/interface/ControlLook.cpp

    From 46a96287351084542997dc317c1d149cd3bf0648 Mon Sep 17 00:00:00 2001
    From: looncraz <looncraz@looncraz.net>
    Date: Mon, 18 Jan 2016 15:07:31 +0000
    Subject: [PATCH] Improve Default BButton default appearance.
    
    Change default control highlight color to be 172, 172, 172 to match previous
    appearance.  In addition, blend color using disable_color so that disabled
    default buttons look properly disabled regardless of color choice.
    ---
     src/kits/interface/ControlLook.cpp   | 13 ++++++-------
     src/kits/interface/InterfaceDefs.cpp |  2 +-
     2 files changed, 7 insertions(+), 8 deletions(-)
    
    diff --git a/src/kits/interface/ControlLook.cpp b/src/kits/interface/ControlLook.cpp
    index 931baf1..cc16de4 100644
    a b BControlLook::_DrawButtonFrame(BView* view, BRect& rect,  
    21492149    rgb_color edgeShadowColor;
    21502150
    21512151    // default button frame color
    2152     // TODO: B_BLEND_FRAME
    2153     float defaultIndicatorTint = 1.2;
    2154     if ((flags & B_DISABLED) != 0)
    2155         defaultIndicatorTint = (B_NO_TINT + defaultIndicatorTint) / 2;
    2156 
    2157     rgb_color defaultIndicatorColor = tint_color(base, defaultIndicatorTint);
     2152    rgb_color defaultIndicatorColor = ui_color(B_CONTROL_HIGHLIGHT_COLOR);
    21582153    rgb_color cornerBgColor;
    21592154
     2155    if ((flags & B_DISABLED) != 0) {
     2156        defaultIndicatorColor = disable_color(defaultIndicatorColor,
     2157            background);
     2158    }
     2159
    21602160    drawing_mode oldMode = view->DrawingMode();
    21612161
    21622162    if ((flags & B_DEFAULT_BUTTON) != 0) {
    2163         defaultIndicatorColor = ui_color(B_CONTROL_HIGHLIGHT_COLOR);
    21642163        cornerBgColor = defaultIndicatorColor;
    21652164        edgeLightColor = _EdgeLightColor(defaultIndicatorColor,
    21662165            contrast * ((flags & B_DISABLED) != 0 ? 0.3 : 0.8),
  • src/kits/interface/InterfaceDefs.cpp

    diff --git a/src/kits/interface/InterfaceDefs.cpp b/src/kits/interface/InterfaceDefs.cpp
    index 97017b3..233b8f0 100644
    a b static const rgb_color _kDefaultColors[kColorWhichCount] = {  
    8787    {245, 245, 245, 255},   // B_CONTROL_BACKGROUND_COLOR
    8888    {0, 0, 0, 255},         // B_CONTROL_TEXT_COLOR
    8989    {0, 0, 0, 255},         // B_CONTROL_BORDER_COLOR
    90     {102, 152, 203, 255},   // B_CONTROL_HIGHLIGHT_COLOR
     90    {172, 172, 172, 255},   // B_CONTROL_HIGHLIGHT_COLOR
    9191    {0, 0, 0, 255},         // B_NAVIGATION_PULSE_COLOR
    9292    {255, 255, 255, 255},   // B_SHINE_COLOR
    9393    {0, 0, 0, 255},         // B_SHADOW_COLOR