WebPositive: fix close tab button in dark mode

Change-Id: Id133626247b8a763d8befd87cc8db0a7048d1218
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7935
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Pascal Abresch
2024-08-08 01:17:02 +00:00
committed by waddlesplash
parent d404a2f036
commit 65de39a14b
+29 -12
View File
@@ -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<TabView*>(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<TabView*>(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