marinofaggiana 5 éve
szülő
commit
d390dc9d76
1 módosított fájl, 8 hozzáadás és 4 törlés
  1. 8 4
      iOSClient/RichWorkspace/NCRichWorkspace.swift

+ 8 - 4
iOSClient/RichWorkspace/NCRichWorkspace.swift

@@ -31,6 +31,7 @@ import MarkdownKit
 
     var markdownParser = MarkdownParser()
     var richWorkspaceText: String?
+    var textViewColor: UIColor?
     //let gradientLayer: CAGradientLayer = CAGradientLayer()
 
     required init?(coder: NSCoder) {
@@ -41,10 +42,13 @@ import MarkdownKit
     }
 
     @objc func changeTheming() {
-        markdownParser = MarkdownParser(font: UIFont.systemFont(ofSize: 15), color: NCBrandColor.sharedInstance.textView)
-        markdownParser.header.font = UIFont.systemFont(ofSize: 25)
-        if let richWorkspaceText = richWorkspaceText {
-            textView.attributedText = markdownParser.parse(richWorkspaceText)
+        if NCBrandColor.sharedInstance.textView != self.textViewColor {
+            markdownParser = MarkdownParser(font: UIFont.systemFont(ofSize: 15), color: NCBrandColor.sharedInstance.textView)
+            markdownParser.header.font = UIFont.systemFont(ofSize: 25)
+            if let richWorkspaceText = richWorkspaceText {
+                textView.attributedText = markdownParser.parse(richWorkspaceText)
+            }
+            self.textViewColor = NCBrandColor.sharedInstance.textView
         }
     }