Преглед изворни кода

add on Capabilities color-element and color-text

Marino Faggiana пре 7 година
родитељ
комит
952bbb11f5

+ 5 - 2
iOSClient/Brand/NCBrand.swift

@@ -32,10 +32,12 @@ class NCBrandColor: NSObject {
 
     // Color
     @objc public let customer:              UIColor = UIColor(red: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 1.0)    // BLU NC : #0082c9
+    @objc public var customerElement:       UIColor = UIColor(red: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 1.0)    // BLU NC : #0082c9
     @objc public var customerText:          UIColor = .white
     
-    @objc public var brand:                 UIColor
-    @objc public var brandText:             UIColor
+    @objc public var brand:                 UIColor                                                                                 // don't touch me
+    @objc public var brandElement:          UIColor                                                                                 // don't touch me
+    @objc public var brandText:             UIColor                                                                                 // don't touch me
 
     @objc public var connectionNo:          UIColor = UIColor(red: 204.0/255.0, green: 204.0/255.0, blue: 204.0/255.0, alpha: 1.0)
     @objc public var encrypted:             UIColor = .red
@@ -48,6 +50,7 @@ class NCBrandColor: NSObject {
 
     override init() {
         self.brand = self.customer
+        self.brandElement = self.customerElement
         self.brandText = self.customerText
     }
     

+ 2 - 0
iOSClient/Database/NCDatabase.swift

@@ -76,6 +76,8 @@ class tableCapabilities: Object {
     @objc dynamic var account = ""
     @objc dynamic var themingBackground = ""
     @objc dynamic var themingColor = ""
+    @objc dynamic var themingColorElement = ""
+    @objc dynamic var themingColorText = ""
     @objc dynamic var themingLogo = ""
     @objc dynamic var themingName = ""
     @objc dynamic var themingSlogan = ""

+ 5 - 2
iOSClient/Database/NCManageDatabase.swift

@@ -57,12 +57,13 @@ class NCManageDatabase: NSObject {
         let config = Realm.Configuration(
         
             fileURL: dirGroup?.appendingPathComponent("\(appDatabaseNextcloud)/\(k_databaseDefault)"),
-            schemaVersion: 13,
+            schemaVersion: 14,
             
             // 10 : Version 2.18.0
             // 11 : Version 2.18.2
             // 12 : Version 2.19.0.5
-            // 13 : ...
+            // 13 : Version 2.19.0.14
+            // 14 : ...
             
             migrationBlock: { migration, oldSchemaVersion in
                 // We haven’t migrated anything yet, so oldSchemaVersion == 0
@@ -562,6 +563,8 @@ class NCManageDatabase: NSObject {
                 resultCapabilities.account = tableAccount.account
                 resultCapabilities.themingBackground = capabilities.themingBackground
                 resultCapabilities.themingColor = capabilities.themingColor
+                resultCapabilities.themingColorElement = capabilities.themingColorElement
+                resultCapabilities.themingColorText = capabilities.themingColorText
                 resultCapabilities.themingLogo = capabilities.themingLogo
                 resultCapabilities.themingName = capabilities.themingName
                 resultCapabilities.themingSlogan = capabilities.themingSlogan

+ 2 - 0
iOSClient/Library/OCCommunicationLib/OCCapabilities.h

@@ -60,6 +60,8 @@
 // Theming
 @property (nonatomic, strong) NSString *themingBackground;
 @property (nonatomic, strong) NSString *themingColor;
+@property (nonatomic, strong) NSString *themingColorElement;
+@property (nonatomic, strong) NSString *themingColorText;
 @property (nonatomic, strong) NSString *themingLogo;
 @property (nonatomic, strong) NSString *themingName;
 @property (nonatomic, strong) NSString *themingSlogan;

+ 2 - 0
iOSClient/Library/OCCommunicationLib/OCCapabilities.m

@@ -23,6 +23,8 @@
         
         self.themingBackground = @"";
         self.themingColor = @"";
+        self.themingColorElement = @"";
+        self.themingColorText = @"";
         self.themingLogo = @"";
         self.themingName = @"";
         self.themingSlogan = @"";

+ 6 - 0
iOSClient/Library/OCCommunicationLib/OCCommunication.m

@@ -1416,6 +1416,12 @@
                     if ([theming valueForKey:@"color"] && ![[theming valueForKey:@"color"] isEqual:[NSNull null]])
                         capabilities.themingColor = [theming valueForKey:@"color"];
                 
+                    if ([theming valueForKey:@"color-element"] && ![[theming valueForKey:@"color-element"] isEqual:[NSNull null]])
+                        capabilities.themingColorElement = [theming valueForKey:@"color-element"];
+                    
+                    if ([theming valueForKey:@"color-text"] && ![[theming valueForKey:@"color-text"] isEqual:[NSNull null]])
+                        capabilities.themingColorText = [theming valueForKey:@"color-text"];
+                    
                     if ([theming valueForKey:@"logo"] && ![[theming valueForKey:@"logo"] isEqual:[NSNull null]])
                         capabilities.themingLogo = [theming valueForKey:@"logo"];