From fc6bd9b7ace2d74675165043bcf4ee3fb5aee7e6 Mon Sep 17 00:00:00 2001
From: looncraz <looncraz@looncraz.net>
Date: Mon, 11 Jul 2016 02:47:23 +0000
Subject: [PATCH] Correct BBox low color for drawing label.
Includes some simplification for existing code.
Fixes ticket# 12628 - which was mostly exhibited in FilWip and a few other legacy
applications which used the default low color and a custom background color.
---
src/kits/interface/Box.cpp | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/kits/interface/Box.cpp b/src/kits/interface/Box.cpp
index 481cba0..7efdbb4 100644
a
|
b
|
BBox::AttachedToWindow()
|
273 | 273 | { |
274 | 274 | AdoptParentColors(); |
275 | 275 | |
276 | | if (ViewColor() == B_TRANSPARENT_COLOR) { |
277 | | SetViewUIColor(B_PANEL_BACKGROUND_COLOR); |
278 | | SetLowUIColor(B_PANEL_BACKGROUND_COLOR); |
279 | | SetHighUIColor(B_PANEL_TEXT_COLOR); |
280 | | } |
| 276 | // Force low color to match view color for proper label drawing. |
| 277 | float viewTint = B_NO_TINT; |
| 278 | float lowTint = B_NO_TINT; |
| 279 | |
| 280 | if (LowUIColor(&lowTint) != ViewUIColor(&viewTint) || viewTint != lowTint) |
| 281 | SetLowUIColor(ViewUIColor(), viewTint); |
| 282 | else if (LowColor() != ViewColor()) |
| 283 | SetLowColor(ViewColor()); |
| 284 | |
| 285 | if (ViewColor() == B_TRANSPARENT_COLOR) |
| 286 | AdoptSystemColors(); |
281 | 287 | |
282 | 288 | // The box could have been resized in the mean time |
283 | 289 | fBounds = Bounds(); |
… |
… |
BBox::_InitObject(BMessage* archive)
|
659 | 665 | fLabelView = ChildAt(0); |
660 | 666 | } |
661 | 667 | |
662 | | SetViewUIColor(B_PANEL_BACKGROUND_COLOR); |
| 668 | AdoptSystemColors(); |
663 | 669 | } |
664 | 670 | |
665 | 671 | |