marinofaggiana 4 年之前
父節點
當前提交
eebff01a6a

+ 1 - 1
iOSClient/Brand/NCBrand.swift

@@ -152,7 +152,7 @@ class NCBrandColor: NSObject {
             backgroundForm = UIColor(red: 247.0/255.0, green: 247.0/255.0, blue: 247.0/255.0, alpha: 1.0)
             textView = .black
             separator = UIColor(red: 235.0/255.0, green: 235.0/255.0, blue: 235.0/255.0, alpha: 1.0)
-            select = self.brand.withAlphaComponent(0.1)
+            select = self.brandElement.withAlphaComponent(0.1)
         }
     }
 }

+ 6 - 6
iOSClient/Main/CCMain.m

@@ -137,7 +137,7 @@
     self.searchController.dimsBackgroundDuringPresentation = NO;
     UIButton *searchButton = self.searchController.searchBar.subviews.firstObject.subviews.lastObject;
     if (searchButton && [searchButton isKindOfClass:[UIButton class]]) {
-        [searchButton setTitleColor:NCBrandColor.sharedInstance.brand forState:UIControlStateNormal];
+        [searchButton setTitleColor:NCBrandColor.sharedInstance.brandElement forState:UIControlStateNormal];
     }
     UITextField *searchTextField = [self.searchController.searchBar valueForKey:@"searchField"];
     if (searchTextField && [searchTextField isKindOfClass:[UITextField class]]) {
@@ -154,7 +154,7 @@
     self.sortButton = self.viewRichWorkspace.sortButton;
     heightSearchBar = self.viewRichWorkspace.topView.frame.size.height;
 
-    [self.sortButton setTitleColor:NCBrandColor.sharedInstance.brand forState:UIControlStateNormal];
+    [self.sortButton setTitleColor:NCBrandColor.sharedInstance.brandElement forState:UIControlStateNormal];
     [self.sortButton addTarget:self action:@selector(toggleReMainMenu) forControlEvents:UIControlEventTouchUpInside];
     
     heightRichWorkspace = UIScreen.mainScreen.bounds.size.height / 4 + heightSearchBar;
@@ -328,13 +328,13 @@
     refreshControl.tintColor = UIColor.lightGrayColor;
     refreshControl.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
 
-    [self.sortButton setTitleColor:NCBrandColor.sharedInstance.brand forState:UIControlStateNormal];
+    [self.sortButton setTitleColor:NCBrandColor.sharedInstance.brandElement forState:UIControlStateNormal];
     // color searchbar
     self.searchController.searchBar.tintColor = NCBrandColor.sharedInstance.brand;
     // color searchbbar button text (cancel)
     UIButton *searchButton = self.searchController.searchBar.subviews.firstObject.subviews.lastObject;
     if (searchButton && [searchButton isKindOfClass:[UIButton class]]) {
-        [searchButton setTitleColor:NCBrandColor.sharedInstance.brand forState:UIControlStateNormal];
+        [searchButton setTitleColor:NCBrandColor.sharedInstance.brandElement forState:UIControlStateNormal];
     }
     // color textview searchbbar
     UITextField *searchTextView = [self.searchController.searchBar valueForKey:@"searchField"];
@@ -1218,7 +1218,7 @@
 - (void)updateSearchResultsForSearchController:(UISearchController *)searchController
 {
     // Color text "Cancel"
-    [[UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UISearchBar class]]] setTintColor:NCBrandColor.sharedInstance.brand];
+    [[UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UISearchBar class]]] setTintColor:NCBrandColor.sharedInstance.brandElement];
     
     if (searchController.isActive) {
         [self deleteRefreshControl];
@@ -2309,7 +2309,7 @@
     UIVisualEffect *blurEffect;
     blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
     visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
-    visualEffectView.backgroundColor = [NCBrandColor.sharedInstance.brand colorWithAlphaComponent:0.2];
+    visualEffectView.backgroundColor = [NCBrandColor.sharedInstance.brandElement colorWithAlphaComponent:0.2];
     
     if ([[CCUtility getGroupBySettings] isEqualToString:@"alphabetic"]) {
         

+ 3 - 9
iOSClient/Main/NCDetailViewController.swift

@@ -118,13 +118,7 @@ class NCDetailViewController: UIViewController {
                         
         appDelegate.progressViewDetail.frame = CGRect(x: 0, y: navigationController.navigationBar.frame.height - 2, width: navigationController.navigationBar.frame.width, height: 2)
         progress(0)
-        
-        if NCBrandColor.sharedInstance.brand.isLight() {
-            appDelegate.progressViewDetail.tintColor = NCBrandColor.sharedInstance.brand.darker(by: 10)
-        } else {
-            appDelegate.progressViewDetail.tintColor = NCBrandColor.sharedInstance.brand.lighter(by: 20)
-        }
-        
+        appDelegate.progressViewDetail.tintColor = NCBrandColor.sharedInstance.brandElement
         appDelegate.progressViewDetail.trackTintColor = .clear
         appDelegate.progressViewDetail.transform = CGAffineTransform(scaleX: 1, y: 1)
         
@@ -172,7 +166,7 @@ class NCDetailViewController: UIViewController {
         appDelegate.changeTheming(self, tableView: nil, collectionView: nil, form: false)
         
         if backgroundView.image != nil {
-            backgroundView.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "logo"), multiplier: 2, color: NCBrandColor.sharedInstance.brand.withAlphaComponent(0.4))
+            backgroundView.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "logo"), multiplier: 2, color: NCBrandColor.sharedInstance.brandElement.withAlphaComponent(0.4))
         }
         
         if navigationController?.isNavigationBarHidden == false {
@@ -428,7 +422,7 @@ class NCDetailViewController: UIViewController {
         self.navigationController?.isNavigationBarHidden = false
         view.backgroundColor = NCBrandColor.sharedInstance.backgroundView
         
-        backgroundView.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "logo"), multiplier: 2, color: NCBrandColor.sharedInstance.brand.withAlphaComponent(0.4))
+        backgroundView.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "logo"), multiplier: 2, color: NCBrandColor.sharedInstance.brandElement.withAlphaComponent(0.4))
     }
     
     private func closeAllSubView() {

+ 1 - 1
iOSClient/Notification/NCNotification.swift

@@ -178,7 +178,7 @@ class NCNotification: UITableViewController, NCNotificationCellDelegate, DZNEmpt
         cell.primary.setTitleColor(.white, for: .normal)
         cell.primary.layer.cornerRadius = 15
         cell.primary.layer.masksToBounds = true
-        cell.primary.layer.backgroundColor = NCBrandColor.sharedInstance.brand.cgColor
+        cell.primary.layer.backgroundColor = NCBrandColor.sharedInstance.brandElement.cgColor
         
         cell.secondary.isEnabled = false
         cell.secondary.isHidden = true

+ 3 - 3
iOSClient/Utility/NCUtility.swift

@@ -111,7 +111,7 @@ class NCUtility: NSObject {
         
         blurEffectView.frame = frame
         blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
-        blurEffectView.backgroundColor = NCBrandColor.sharedInstance.brand.withAlphaComponent(0.2)
+        blurEffectView.backgroundColor = NCBrandColor.sharedInstance.brandElement.withAlphaComponent(0.2)
         
         return blurEffectView
     }
@@ -274,12 +274,12 @@ class NCUtility: NSObject {
     @objc func blink(cell: AnyObject?) {
         DispatchQueue.main.async {
             if let cell = cell as? UITableViewCell {
-                cell.backgroundColor = NCBrandColor.sharedInstance.brand.withAlphaComponent(0.3)
+                cell.backgroundColor = NCBrandColor.sharedInstance.brandElement.withAlphaComponent(0.3)
                 UIView.animate(withDuration: 2) {
                     cell.backgroundColor = .clear
                 }
             } else if let cell = cell as? UICollectionViewCell {
-                cell.backgroundColor = NCBrandColor.sharedInstance.brand.withAlphaComponent(0.3)
+                cell.backgroundColor = NCBrandColor.sharedInstance.brandElement.withAlphaComponent(0.3)
                 UIView.animate(withDuration: 2) {
                     cell.backgroundColor = .clear
                 }