mirror of
https://review.haiku-os.org/haiku
synced 2025-01-18 04:28:52 +01:00
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 <no-reply+haikuformatbot@haiku-os.org> Reviewed-by: waddlesplash <waddlesplash@gmail.com> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
parent
9105063938
commit
0d50dc1f3e
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user