From 0d50dc1f3eabed616a236e588c7d2b3b126b6cb5 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Mon, 9 Sep 2024 15:42:27 -0400 Subject: [PATCH] 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 Reviewed-by: waddlesplash Tested-by: Commit checker robot --- src/kits/tracker/TextWidget.cpp | 7 +++---- src/kits/tracker/Utilities.cpp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/kits/tracker/TextWidget.cpp b/src/kits/tracker/TextWidget.cpp index 3d36f8d803..79dbb58ebf 100644 --- a/src/kits/tracker/TextWidget.cpp +++ b/src/kits/tracker/TextWidget.cpp @@ -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(); diff --git a/src/kits/tracker/Utilities.cpp b/src/kits/tracker/Utilities.cpp index 9c5ab16123..a07b498ba0 100644 --- a/src/kits/tracker/Utilities.cpp +++ b/src/kits/tracker/Utilities.cpp @@ -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; }