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,
|
2149 | 2149 | rgb_color edgeShadowColor; |
2150 | 2150 | |
2151 | 2151 | // 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); |
2158 | 2153 | rgb_color cornerBgColor; |
2159 | 2154 | |
| 2155 | if ((flags & B_DISABLED) != 0) { |
| 2156 | defaultIndicatorColor = disable_color(defaultIndicatorColor, |
| 2157 | background); |
| 2158 | } |
| 2159 | |
2160 | 2160 | drawing_mode oldMode = view->DrawingMode(); |
2161 | 2161 | |
2162 | 2162 | if ((flags & B_DEFAULT_BUTTON) != 0) { |
2163 | | defaultIndicatorColor = ui_color(B_CONTROL_HIGHLIGHT_COLOR); |
2164 | 2163 | cornerBgColor = defaultIndicatorColor; |
2165 | 2164 | edgeLightColor = _EdgeLightColor(defaultIndicatorColor, |
2166 | 2165 | contrast * ((flags & B_DISABLED) != 0 ? 0.3 : 0.8), |
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] = {
|
86 | 86 | {0, 0, 0, 255}, // B_DOCUMENT_TEXT_COLOR |
87 | 87 | {245, 245, 245, 255}, // B_CONTROL_BACKGROUND_COLOR |
88 | 88 | {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 |
90 | 90 | {102, 152, 203, 255}, // B_CONTROL_HIGHLIGHT_COLOR |
91 | 91 | {0, 0, 0, 255}, // B_NAVIGATION_PULSE_COLOR |
92 | 92 | {255, 255, 255, 255}, // B_SHINE_COLOR |