forked from shadowfacts/Tusker
visionOS: Use UIColor.link for text links
This commit is contained in:
parent
a93a4fccc1
commit
9d01bbabd7
|
@ -78,9 +78,15 @@ class ContentTextView: LinkTextView, BaseEmojiLabel {
|
|||
textContainerInset = .zero
|
||||
textContainer.lineFragmentPadding = 0
|
||||
|
||||
#if os(visionOS)
|
||||
linkTextAttributes = [
|
||||
.foregroundColor: UIColor.link
|
||||
]
|
||||
#else
|
||||
linkTextAttributes = [
|
||||
.foregroundColor: UIColor.tintColor
|
||||
]
|
||||
#endif
|
||||
updateLinkUnderlineStyle()
|
||||
|
||||
// the text view's builtin link interaction code is tied to isSelectable, so we need to use our own tap recognizer
|
||||
|
|
|
@ -48,7 +48,11 @@ class ProfileFieldValueView: UIView {
|
|||
|
||||
converted.enumerateAttribute(.link, in: converted.fullRange) { value, range, stop in
|
||||
guard value != nil else { return }
|
||||
#if os(visionOS)
|
||||
converted.addAttribute(.foregroundColor, value: UIColor.link, range: range)
|
||||
#else
|
||||
converted.addAttribute(.foregroundColor, value: UIColor.tintColor, range: range)
|
||||
#endif
|
||||
// the .link attribute in a UILabel always makes the color blue >.>
|
||||
converted.removeAttribute(.link, range: range)
|
||||
}
|
||||
|
|
|
@ -69,7 +69,11 @@ class StatusCardView: UIView {
|
|||
domainLabel.font = .preferredFont(forTextStyle: .caption2)
|
||||
domainLabel.adjustsFontForContentSizeCategory = true
|
||||
domainLabel.numberOfLines = 1
|
||||
#if os(visionOS)
|
||||
domainLabel.textColor = .link
|
||||
#else
|
||||
domainLabel.textColor = .tintColor
|
||||
#endif
|
||||
|
||||
vStack = UIStackView(arrangedSubviews: [
|
||||
titleLabel,
|
||||
|
|
Loading…
Reference in New Issue