浏览代码

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 年之前
父节点
当前提交
bcd1f1994f

+ 12 - 0
iOSClient/Images.xcassets/removepalette.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "removepalette.svg",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

文件差异内容过多而无法显示
+ 2 - 0
iOSClient/Images.xcassets/removepalette.imageset/removepalette.svg


+ 15 - 17
iOSClient/Menu/NCCollectionViewCommon+Menu.swift

@@ -296,39 +296,37 @@ extension NCCollectionViewCommon {
         }
 
         //
-        // CHANGE COLOR
+        // COLOR FOLDER
         //
         if #available(iOS 14.0, *), metadata.directory {
 
             let serverUrl = metadata.serverUrl + "/" + metadata.fileName
             let tableDirectory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", metadata.account, serverUrl))
 
-            actions.append(
-                NCMenuAction(
-                    title: NSLocalizedString("_change_color_", comment: ""),
-                    icon: NCUtility.shared.loadImage(named: "palette"),
-                    action: { _ in
-                        let picker = UIColorPickerViewController()
-                        picker.delegate = self
-                        if let colorFolderHex = tableDirectory?.colorFolder, let color = UIColor(hex: colorFolderHex) {
-                            picker.selectedColor = color
-                        }
-                        self.present(picker, animated: true, completion: nil)
-                    }
-                )
-            )
-
             if tableDirectory?.colorFolder != nil {
                 actions.append(
                     NCMenuAction(
                         title: NSLocalizedString("_remove_color_", comment: ""),
-                        icon: NCUtility.shared.loadImage(named: "palette"),
+                        icon: NCUtility.shared.loadImage(named: "removepalette"),
                         action: { _ in
                             NCManageDatabase.shared.setDirectory(serverUrl: serverUrl, colorFolder: nil, account: metadata.account)
                             self.reloadDataSource()
                         }
                     )
                 )
+            } else {
+                actions.append(
+                    NCMenuAction(
+                        title: NSLocalizedString("_change_color_", comment: ""),
+                        icon: NCUtility.shared.loadImage(named: "palette"),
+                        action: { _ in
+                            let picker = UIColorPickerViewController()
+                            picker.delegate = self
+                            picker.supportsAlpha = false
+                            self.present(picker, animated: true, completion: nil)
+                        }
+                    )
+                )
             }
         }
         

部分文件因为文件数量过多而无法显示