|
@@ -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)
|
|
|
+ }
|
|
|
+ )
|
|
|
+ )
|
|
|
}
|
|
|
}
|
|
|
|