瀏覽代碼

Fix dark mode not updating view

Signed-off-by: Philippe Weidmann <philippe.weidmann@infomaniak.com>
Philippe Weidmann 4 年之前
父節點
當前提交
7e168ace37
共有 2 個文件被更改,包括 16 次插入0 次删除
  1. 15 0
      iOSClient/AppDelegate.m
  2. 1 0
      iOSClient/Main/NCMainTabBar.swift

+ 15 - 0
iOSClient/AppDelegate.m

@@ -1025,6 +1025,21 @@
 
 - (void)changeTheming:(UIViewController *)viewController tableView:(UITableView *)tableView collectionView:(UICollectionView *)collectionView form:(BOOL)form
 {
+    [NCBrandColor.sharedInstance setDarkMode];
+    
+    //Tab bar
+    UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
+    if ([splitViewController isKindOfClass:[UISplitViewController class]]) {
+        UINavigationController *masterNavigationController = [splitViewController.viewControllers firstObject];
+        if ([masterNavigationController isKindOfClass:[UINavigationController class]]) {
+            UITabBarController *tabBarController = [masterNavigationController.viewControllers firstObject];
+            if ([tabBarController isKindOfClass:[UITabBarController class]]) {
+                tabBarController.tabBar.backgroundColor = NCBrandColor.sharedInstance.tabBar;
+            }
+        }
+    }
+    
+    // Nav bar
     [self configureNavBarForViewController:viewController];
 
     // View

+ 1 - 0
iOSClient/Main/NCMainTabBar.swift

@@ -35,6 +35,7 @@ import Foundation
         }
         set {
             fillColor = newValue
+            self.setNeedsDisplay()
         }
     }