Compare commits

...

2 Commits

Author SHA1 Message Date
Shadowfacts 38085eee37
Fix not being able to collapse/expand statuses
Instead of simply returning the content text view from hitTest(_:with:),
we need to call the super method so that the system still performs its
own checks.
2020-01-18 18:38:00 -05:00
Shadowfacts e19364abdf
Fix content text view text color in dark mode 2020-01-18 18:21:01 -05:00
1 changed files with 4 additions and 3 deletions

View File

@ -19,6 +19,7 @@ class ContentTextView: LinkTextView {
var navigationDelegate: TuskerNavigationDelegate? var navigationDelegate: TuskerNavigationDelegate?
var defaultFont: UIFont = .systemFont(ofSize: 17) var defaultFont: UIFont = .systemFont(ofSize: 17)
var defaultColor: UIColor = .label
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
@ -117,9 +118,9 @@ class ContentTextView: LinkTextView {
} else { } else {
text = node.text() text = node.text()
} }
return NSAttributedString(string: text, attributes: [.font: defaultFont]) return NSAttributedString(string: text, attributes: [.font: defaultFont, .foregroundColor: defaultColor])
case let node as Element: case let node as Element:
let attributed = NSMutableAttributedString(string: "", attributes: [.font: defaultFont]) let attributed = NSMutableAttributedString(string: "", attributes: [.font: defaultFont, .foregroundColor: defaultColor])
for child in node.getChildNodes() { for child in node.getChildNodes() {
attributed.append(attributedTextForHTMLNode(child, usePreformattedText: usePreformattedText || node.tagName() == "pre")) attributed.append(attributedTextForHTMLNode(child, usePreformattedText: usePreformattedText || node.tagName() == "pre"))
} }
@ -180,7 +181,7 @@ class ContentTextView: LinkTextView {
// only accept touches that are over a link // only accept touches that are over a link
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
if getLinkAtPoint(point) != nil || isSelectable { if getLinkAtPoint(point) != nil || isSelectable {
return self return super.hitTest(point, with: event)
} else { } else {
return nil return nil
} }