From 25af167e8f1d33b0931741434a814a59765505eb Mon Sep 17 00:00:00 2001 From: John Scipione Date: Sat, 20 Jun 2015 16:14:53 -0700 Subject: [PATCH] Spinner: Tweak the spinner button colors * Tint the button text 1.777f which yields #303030 for the text color which produces a nice dark grey but-not-quite-black color. In testing black text is too dark and B_DARKEN_4_TINT (1.555f) yields #606060 which is too light. #303030 is a compromise between the two. * The button text gets darkened to black on mouse down and the button background gets darkened to B_DARKEN_1_TINT on hover as before, but the frame color is no longer affected --- the button frame tinted by B_DARKEN_1_TINT always (yielding standard Haiku button frame color). --- src/kits/interface/AbstractSpinner.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/AbstractSpinner.cpp b/src/kits/interface/AbstractSpinner.cpp index 1a1c31bb85..576697a835 100644 --- a/src/kits/interface/AbstractSpinner.cpp +++ b/src/kits/interface/AbstractSpinner.cpp @@ -349,13 +349,15 @@ SpinnerButton::Draw(BRect updateRect) BView::Draw(updateRect); + float frameTint = B_DARKEN_1_TINT; + float fgTint; if (!fIsEnabled) fgTint = B_DARKEN_1_TINT; else if (fIsMouseDown) fgTint = B_DARKEN_MAX_TINT; else - fgTint = B_DARKEN_3_TINT; + fgTint = 1.777f; // 216 --> 48.2 (48) float bgTint; if (fIsEnabled && fIsMouseOver) @@ -366,6 +368,7 @@ SpinnerButton::Draw(BRect updateRect) rgb_color bgColor = ui_color(B_PANEL_BACKGROUND_COLOR); if (bgColor.red + bgColor.green + bgColor.blue <= 128 * 3) { // if dark background make the tint lighter + frameTint = 2.0f - frameTint; fgTint = 2.0f - fgTint; bgTint = 2.0f - bgTint; } @@ -380,7 +383,7 @@ SpinnerButton::Draw(BRect updateRect) // draw the button be_control_look->DrawButtonFrame(this, rect, updateRect, - tint_color(bgColor, fgTint), bgColor, 0, borders); + tint_color(bgColor, frameTint), bgColor, 0, borders); be_control_look->DrawButtonBackground(this, rect, updateRect, tint_color(bgColor, bgTint), 0, borders);