marinofaggiana 5 年之前
父節點
當前提交
49f9ec5aa8
共有 5 個文件被更改,包括 10 次插入15 次删除
  1. 0 1
      iOSClient/AppDelegate.h
  2. 3 7
      iOSClient/AppDelegate.m
  3. 3 0
      iOSClient/Main/CCMain.m
  4. 1 1
      iOSClient/Main/CCSplit.m
  5. 3 6
      iOSClient/Settings/CCSettings.m

+ 0 - 1
iOSClient/AppDelegate.h

@@ -169,7 +169,6 @@
 // Theming Color
 - (void)settingThemingColorBrand;
 - (void)changeTheming:(UIViewController *)viewController tableView:(UITableView *)tableView collectionView:(UICollectionView *)collectionView;
-- (void)settingDarkMode;
 
 // Task Networking
 - (void)loadAutoDownloadUpload;

+ 3 - 7
iOSClient/AppDelegate.m

@@ -1002,6 +1002,9 @@ PKPushRegistry *pushRegistry;
 
 - (void)changeTheming:(UIViewController *)viewController tableView:(UITableView *)tableView collectionView:(UICollectionView *)collectionView
 {
+    // Dark Mode
+    [NCBrandColor.sharedInstance setDarkMode];
+    
     // NavigationBar
     if (viewController.navigationController.navigationBar) {
         viewController.navigationController.navigationBar.translucent = false;
@@ -1048,13 +1051,6 @@ PKPushRegistry *pushRegistry;
     [self.window setTintColor:NCBrandColor.sharedInstance.textView];
 }
 
-- (void)settingDarkMode
-{
-    [NCBrandColor.sharedInstance setDarkMode];
-    [[NCMainCommon sharedInstance] createImagesThemingColor];
-    [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"changeTheming" object:nil];
-}
-
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Manager Passcode =====
 #pragma --------------------------------------------------------------------------------------------

+ 3 - 0
iOSClient/Main/CCMain.m

@@ -272,6 +272,9 @@
 {
     [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
     
+    // createImagesThemingColor
+    [[NCMainCommon sharedInstance] createImagesThemingColor];
+    
     // Refresh control
     refreshControl.tintColor = NCBrandColor.sharedInstance.brandText;
     refreshControl.backgroundColor = NCBrandColor.sharedInstance.brand;

+ 1 - 1
iOSClient/Main/CCSplit.m

@@ -289,7 +289,7 @@
                 [CCUtility setDarkMode:NO];
             }
                 
-            [appDelegate settingDarkMode];
+            [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"changeTheming" object:nil];
         }
     }
     

+ 3 - 6
iOSClient/Settings/CCSettings.m

@@ -201,6 +201,7 @@
 {
     [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
     [self initializeForm];
+    [self reloadForm];
 }
 
 #pragma --------------------------------------------------------------------------------------------
@@ -300,7 +301,6 @@
             [CCUtility setDarkMode:false];
         }
         
-        [appDelegate settingDarkMode];
         [self changeTheming];
         [self initializeForm];
         [self reloadForm];
@@ -320,16 +320,13 @@
                     [CCUtility setDarkMode:NO];
                 }
                 
-                [appDelegate settingDarkMode];
+                [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"changeTheming" object:nil];
             }
             
         } else {
             [CCUtility setDarkModeDetect:false];
             
-            [appDelegate settingDarkMode];
-            [self changeTheming];
-            [self initializeForm];
-            [self reloadForm];
+            [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"changeTheming" object:nil];
         }
     }
 }