From 65de39a14be2243fcbb1dd6114040f68aa51b764 Mon Sep 17 00:00:00 2001 From: Pascal Abresch Date: Thu, 8 Aug 2024 01:20:49 +0200 Subject: [PATCH] WebPositive: fix close tab button in dark mode Change-Id: Id133626247b8a763d8befd87cc8db0a7048d1218 Reviewed-on: https://review.haiku-os.org/c/haiku/+/7935 Reviewed-by: waddlesplash --- src/apps/webpositive/tabview/TabManager.cpp | 41 +++++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/src/apps/webpositive/tabview/TabManager.cpp b/src/apps/webpositive/tabview/TabManager.cpp index 96c3513e5f..d55033b042 100644 --- a/src/apps/webpositive/tabview/TabManager.cpp +++ b/src/apps/webpositive/tabview/TabManager.cpp @@ -623,19 +623,36 @@ WebTabView::_DrawCloseButton(BView* owner, BRect& frame, closeRect.bottom = closeRect.top + 6; rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR); - float tint = B_DARKEN_1_TINT; - - float isFront = ContainerView()->SelectedTab() - == static_cast(this); - if (!isFront) { - base = tint_color(base, tint); - tint *= 1.02; - } - - if (fOverCloseRect) - tint *= 1.4; + + float tint; + if (base.IsLight()) + tint = B_DARKEN_1_TINT; else - tint *= 1.2; + tint = 0.50; + + float isFront = ContainerView()->SelectedTab() == static_cast(this); + + if (base.IsLight()){ + if (!isFront) { + base = tint_color(base, tint); + tint *= 1.02; + } + + if (fOverCloseRect) + tint *= 1.4; + else + tint *= 1.2; + } else { + if (!isFront) { + base = tint_color(base, tint); + tint *= 0.80; + } + + if (fOverCloseRect) + tint *= 0.6; + else + tint *= 0.9; + } if (fClicked && fOverCloseRect) { // Draw the button frame