Quellcode durchsuchen

Merge pull request #1078 from Infomaniak/fix-darkmode

Fix darkmode in some views
Marino Faggiana vor 5 Jahren
Ursprung
Commit
7be6b72648

+ 7 - 2
iOSClient/Share/NCShareCommon.swift

@@ -147,7 +147,13 @@ class NCShareCommon: NSObject {
         
         let calendar = FSCalendar(frame: CGRect(x: globalPoint!.x + 10, y: globalPoint!.y + 10, width: width - 20, height: 300))
         
-        calendar.backgroundColor = .white
+        if #available(iOS 13.0, *) {
+            calendar.backgroundColor = .systemBackground
+            calendar.appearance.headerTitleColor = .label
+        } else {
+            calendar.backgroundColor = .white
+            calendar.appearance.headerTitleColor = .black
+        }
         calendar.placeholderType = .none
         calendar.appearance.headerMinimumDissolvedAlpha = 0.0
         
@@ -159,7 +165,6 @@ class NCShareCommon: NSObject {
         calendar.layer.shadowOffset = CGSize(width: 2, height: 2)
         calendar.layer.shadowOpacity = 0.2
         
-        calendar.appearance.headerTitleColor = .black
         calendar.appearance.headerTitleFont = UIFont.systemFont(ofSize: 13)
         
         calendar.appearance.weekdayTextColor = UIColor(red: 100/255, green: 100/255, blue: 100/255, alpha: 1)

+ 1 - 5
iOSClient/Viewer/NCViewerDocumentWeb.swift

@@ -73,11 +73,7 @@ class NCViewerDocumentWeb: NSObject {
         let webView = WKWebView(frame: CGRect(x: 0, y: 0, width: Int(detail.view.bounds.size.width), height: Int(detail.view.bounds.size.height) - Int(k_detail_Toolbar_Height) - safeAreaBottom - 1), configuration: configuration)
         webView.navigationDelegate = self
         webView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
-        if CCUtility.getDarkMode() {
-            webView.backgroundColor = .lightGray
-        } else {
-            webView.backgroundColor = .white
-        }
+        webView.backgroundColor = .white
         
         webView.isOpaque = false