浏览代码

teming color

Marino Faggiana 8 年之前
父节点
当前提交
f874ed9ce2
共有 3 个文件被更改,包括 21 次插入5 次删除
  1. 7 1
      iOSClient/AppDelegate.m
  2. 13 4
      iOSClient/Create/CCCreateCloud.swift
  3. 1 0
      iOSClient/Nextcloud-Bridging-Header.h

+ 7 - 1
iOSClient/AppDelegate.m

@@ -926,7 +926,13 @@
 
 - (void)handleTouchTabbarCenter:(id)sender
 {
-    CreateMenuAdd *menuAdd = [[CreateMenuAdd alloc] init];
+    UIColor *ThemingColor = [NCBrandColor sharedInstance].navigationBar;
+    
+    TableCapabilities *capabilities = [CCCoreData getCapabilitesForAccount:self.activeAccount];
+    if (k_option_use_themingColor == YES && capabilities.themingColor.length > 0)
+        ThemingColor = [CCGraphics colorFromHexString:capabilities.themingColor];
+    
+    CreateMenuAdd *menuAdd = [[CreateMenuAdd alloc] initWithThemingColor:ThemingColor];
     
     if ([CCUtility getCreateMenuEncrypted])
         [menuAdd createMenuEncryptedWithView:self.window.rootViewController.view];

+ 13 - 4
iOSClient/Create/CCCreateCloud.swift

@@ -27,12 +27,21 @@ import Foundation
 
 class CreateMenuAdd: NSObject {
     
+    let appDelegate = UIApplication.shared.delegate as! AppDelegate
+
     let fontButton = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: UIColor(colorLiteralRed: 65.0/255.0, green: 64.0/255.0, blue: 66.0/255.0, alpha: 1.0)]
     let fontEncrypted = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: NCBrandColor.sharedInstance.cryptocloud] as [String : Any]
     let fontCancel = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: NCBrandColor.sharedInstance.navigationBar] as [String : Any]
     let fontDisable = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: UIColor(colorLiteralRed: 65.0/255.0, green: 64.0/255.0, blue: 66.0/255.0, alpha: 1.0)]
 
     let colorLightGray = UIColor(colorLiteralRed: 250.0/255.0, green: 250.0/255.0, blue: 250.0/255.0, alpha: 1)
+    var colorIcon = NCBrandColor.sharedInstance.brand
+    
+    init (themingColor : UIColor) {
+        super.init()
+        
+        colorIcon = themingColor
+    }
     
     func createMenuPlain(view : UIView) {
         
@@ -57,16 +66,16 @@ class CreateMenuAdd: NSObject {
         actionSheet.disableButtonTextAttributes = fontDisable
         
         actionSheet.cancelButtonTitle = NSLocalizedString("_cancel_", comment: "")
-
-        actionSheet.addButton(withTitle: NSLocalizedString("_create_folder_", comment: ""), image: UIImage(named: image_folder), backgroundColor: UIColor.white, height: 50.0 ,type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
+        
+        actionSheet.addButton(withTitle: NSLocalizedString("_create_folder_", comment: ""), image: CCGraphics.changeThemingColorImage(UIImage(named: image_folder), color: colorIcon), backgroundColor: UIColor.white, height: 50.0 ,type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
             appDelegate.activeMain.returnCreate(Int(k_returnCreateFolderPlain))
         })
         
-        actionSheet.addButton(withTitle: NSLocalizedString("_upload_photos_videos_", comment: ""), image: UIImage(named: image_MenuUploadPhoto), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
+        actionSheet.addButton(withTitle: NSLocalizedString("_upload_photos_videos_", comment: ""), image: CCGraphics.changeThemingColorImage(UIImage(named: image_MenuUploadPhoto), color: colorIcon), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
             appDelegate.activeMain.returnCreate(Int(k_returnCreateFotoVideoPlain))
         })
         
-        actionSheet.addButton(withTitle: NSLocalizedString("_upload_file_", comment: ""), image: UIImage(named: image_MenuUploadFile), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
+        actionSheet.addButton(withTitle: NSLocalizedString("_upload_file_", comment: ""), image: CCGraphics.changeThemingColorImage(UIImage(named: image_MenuUploadFile), color: colorIcon), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
             appDelegate.activeMain.returnCreate(Int(k_returnCreateFilePlain))
         })
         

+ 1 - 0
iOSClient/Nextcloud-Bridging-Header.h

@@ -7,6 +7,7 @@
 #import "OCNetworking.h"
 #import "TWMessageBarManager.h"
 #import "CCManageAccount.h"
+#import "CCGraphics.h"
 
 #import <OCCommunicationLib/OCNotifications.h>
 #import <OCCommunicationLib/OCNotificationsAction.h>