Ticket #12589: BButton-Default-Appearance-2.patch

File BButton-Default-Appearance-2.patch, 2.4 KB (added by looncraz, 9 years ago)

Using B_CONTROL_BORDER_COLOR

  • src/kits/interface/ControlLook.cpp

    From 48ae53aa08dba57cc7f1f3519dca671572b0fc0e Mon Sep 17 00:00:00 2001
    From: looncraz <looncraz@looncraz.net>
    Date: Mon, 18 Jan 2016 15:30:59 +0000
    Subject: [PATCH] Improve Default BButton Appearance
    
    Change control border color to 172, 172, 172 and use for default button
    indicator drawing.
    
    People doing an in-place upgrade will need to modify the border color from
    its previous default manually or by pressing "Default" in the Appearance
    preflet.  This is a one-time annoyance.
    ---
     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..252e400 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_BORDER_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..6c8d980 100644
    a b static const rgb_color _kDefaultColors[kColorWhichCount] = {  
    8686    {0, 0, 0, 255},         // B_DOCUMENT_TEXT_COLOR
    8787    {245, 245, 245, 255},   // B_CONTROL_BACKGROUND_COLOR
    8888    {0, 0, 0, 255},         // B_CONTROL_TEXT_COLOR
    89     {0, 0, 0, 255},         // B_CONTROL_BORDER_COLOR
     89    {172, 172, 172, 255},   // B_CONTROL_BORDER_COLOR
    9090    {102, 152, 203, 255},   // B_CONTROL_HIGHLIGHT_COLOR
    9191    {0, 0, 0, 255},         // B_NAVIGATION_PULSE_COLOR
    9292    {255, 255, 255, 255},   // B_SHINE_COLOR