|
@@ -58,6 +58,11 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate
|
|
|
gradient.startPoint = CGPoint(x: 0, y: 0.60)
|
|
|
gradient.endPoint = CGPoint(x: 0, y: 1)
|
|
|
viewRichWorkspace.layer.addSublayer(gradient)
|
|
|
+ if traitCollection.userInterfaceStyle == .dark {
|
|
|
+ gradient.colors = [UIColor.init(white: 0, alpha: 0).cgColor, UIColor.black.cgColor]
|
|
|
+ } else {
|
|
|
+ gradient.colors = [UIColor.init(white: 1, alpha: 0).cgColor, UIColor.white.cgColor]
|
|
|
+ }
|
|
|
|
|
|
let tap = UITapGestureRecognizer(target: self, action: #selector(touchUpInsideViewRichWorkspace(_:)))
|
|
|
tap.delegate = self
|
|
@@ -72,8 +77,6 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate
|
|
|
textViewRichWorkspace.attributedText = markdownParser.parse(richWorkspaceText)
|
|
|
}
|
|
|
textViewColor = NCBrandColor.shared.label
|
|
|
-
|
|
|
- changeColor()
|
|
|
}
|
|
|
|
|
|
override func layoutSublayers(of layer: CALayer) {
|
|
@@ -84,10 +87,6 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate
|
|
|
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
|
|
|
super.traitCollectionDidChange(previousTraitCollection)
|
|
|
|
|
|
- changeColor()
|
|
|
- }
|
|
|
-
|
|
|
- func changeColor() {
|
|
|
if traitCollection.userInterfaceStyle == .dark {
|
|
|
gradient.colors = [UIColor.init(white: 0, alpha: 0).cgColor, UIColor.black.cgColor]
|
|
|
} else {
|