Tracker: Call AdoptSystemColors() to apply read-only tint

2 - 1.147 = 0.853

Change-Id: I260af9d07f5e43e939ce351bfd4036665ad126f4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8269
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
John Scipione
2025-01-17 16:57:38 +00:00
committed by waddlesplash
parent 9105063938
commit 0d50dc1f3e
2 changed files with 4 additions and 5 deletions
+3 -4
View File
@@ -456,13 +456,12 @@ BTextWidget::StartEdit(BRect bounds, BPoseView* view, BPose* pose)
textView->AddFilter(new BMessageFilter(B_KEY_DOWN, TextViewKeyDownFilter));
if (view->SelectedVolumeIsReadOnly()) {
textView->AdoptSystemColors();
textView->MakeEditable(false);
textView->MakeSelectable(true);
// tint text view background color to indicate not editable
textView->SetViewColor(tint_color(textView->ViewColor(),
ReadOnlyTint(textView->ViewColor())));
} else
} else {
textView->AddFilter(new BMessageFilter(B_PASTE, TextViewPasteFilter));
}
// get full text length
rect.right = rect.left + textView->LineWidth();
+1 -1
View File
@@ -91,7 +91,7 @@ float
ReadOnlyTint(rgb_color base)
{
// darken tint if read-only (or lighten if dark)
return base.IsLight() ? B_DARKEN_1_TINT : 0.85;
return base.IsLight() ? B_DARKEN_1_TINT : 0.853;
}