From ff29be86b3323963d95e2c6442afff116d08de8a Mon Sep 17 00:00:00 2001
From: looncraz <looncraz@looncraz.net>
Date: Wed, 6 Jan 2016 12:44:41 -0600
Subject: [PATCH] Tracker Column Title Colors
Repair regression where low color for text drawing was not set properly.
Do not use tinted color for default color state.
Prior to this, the hinting font would not respond to being pressed and the column title
background was the wrong color initially, but correct after resizing (but then wrong again
after a redraw on exposure).
In addition, the initial tint values used for the view color were unused, so I removed them.
---
src/kits/tracker/TitleView.cpp | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/kits/tracker/TitleView.cpp b/src/kits/tracker/TitleView.cpp
index 9314bca..22b027d 100644
a
|
b
|
All rights reserved.
|
56 | 56 | |
57 | 57 | #define APP_SERVER_CLEARS_BACKGROUND 1 |
58 | 58 | |
59 | | |
60 | 59 | static void |
61 | 60 | _DrawLine(BPoseView* view, BPoint from, BPoint to) |
62 | 61 | { |
… |
… |
BTitleView::BTitleView(BPoseView* view)
|
101 | 100 | fPreviousLeftClickTime(0), |
102 | 101 | fTrackingState(NULL) |
103 | 102 | { |
104 | | SetHighUIColor(B_PANEL_BACKGROUND_COLOR, 0.88f); |
105 | | SetLowUIColor(B_PANEL_BACKGROUND_COLOR, 0.88f); |
| 103 | SetHighUIColor(B_PANEL_BACKGROUND_COLOR); |
| 104 | SetLowUIColor(B_PANEL_BACKGROUND_COLOR); |
106 | 105 | #if APP_SERVER_CLEARS_BACKGROUND |
107 | | SetViewUIColor(B_PANEL_BACKGROUND_COLOR, 0.88f); |
| 106 | SetViewUIColor(B_PANEL_BACKGROUND_COLOR); |
108 | 107 | #else |
109 | 108 | SetViewColor(B_TRANSPARENT_COLOR); |
110 | 109 | #endif |
… |
… |
BTitleView::Draw(BRect /*updateRect*/, bool useOffscreen, bool updateOnly,
|
229 | 228 | view->StrokeLine(bounds.LeftBottom(), bounds.RightBottom()); |
230 | 229 | bounds.bottom--; |
231 | 230 | |
232 | | be_control_look->DrawButtonBackground(view, bounds, bounds, HighColor(), 0, |
| 231 | rgb_color baseColor = ui_color(B_PANEL_BACKGROUND_COLOR); |
| 232 | be_control_look->DrawButtonBackground(view, bounds, bounds, baseColor, 0, |
233 | 233 | BControlLook::B_TOP_BORDER | BControlLook::B_BOTTOM_BORDER); |
234 | 234 | |
235 | 235 | int32 count = fTitleList.CountItems(); |
… |
… |
BColumnTitle::Draw(BView* view, bool pressed)
|
470 | 470 | font_height height; |
471 | 471 | view->GetFontHeight(&height); |
472 | 472 | BPoint loc(0, bounds.top + ceilf(height.ascent) + 2); |
| 473 | rgb_color baseColor = ui_color(B_PANEL_BACKGROUND_COLOR); |
473 | 474 | |
474 | 475 | if (pressed) { |
475 | 476 | bounds.bottom--; |
476 | 477 | BRect rect(bounds); |
477 | 478 | rect.right--; |
478 | | rgb_color base = tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), |
479 | | B_DARKEN_1_TINT); |
| 479 | baseColor = tint_color(baseColor, B_DARKEN_1_TINT); |
480 | 480 | |
481 | | be_control_look->DrawButtonBackground(view, rect, rect, base, 0, |
| 481 | be_control_look->DrawButtonBackground(view, rect, rect, baseColor, 0, |
482 | 482 | BControlLook::B_TOP_BORDER | BControlLook::B_BOTTOM_BORDER); |
483 | 483 | } |
484 | 484 | |
… |
… |
BColumnTitle::Draw(BView* view, bool pressed)
|
503 | 503 | break; |
504 | 504 | } |
505 | 505 | |
506 | | view->SetHighUIColor(B_PANEL_TEXT_COLOR, 0.8f); |
507 | | view->SetLowUIColor(B_PANEL_BACKGROUND_COLOR, pressed ? 1.1 : 1.0); |
| 506 | view->SetHighUIColor(B_PANEL_TEXT_COLOR, pressed ? B_DARKEN_1_TINT : 1.0f); |
| 507 | view->SetLowColor(baseColor); |
508 | 508 | view->DrawString(titleString.String(), loc); |
509 | 509 | |
510 | 510 | // show sort columns |