Преглед на файлове

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()
         }
     }