Skip to content

Commit 2b3e49b

Browse files
NMC-5296 - iOS v10.2.2.3 - File Browser: Icon for copy/move difficult to see in dark mode
1 parent 850ebeb commit 2b3e49b

File tree

10 files changed

+47
-43
lines changed

10 files changed

+47
-43
lines changed

Brand/NCBrand.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,15 @@ final class NCBrandOptions: @unchecked Sendable {
162162
}
163163
}
164164

165-
final class NCBrandColor: @unchecked Sendable {
166-
static let shared = NCBrandColor()
165+
@objc final class NCBrandColor: NSObject, @unchecked Sendable {
166+
//final class NCBrandColor: @unchecked Sendable {
167+
@objc static let shared = NCBrandColor()
167168

168169
// This is rewrited from customet theme, default is Nextcloud color
169170
let customer: UIColor = UIColor(red: 226.0/255.0, green: 0.0/255.0, blue: 116.0/255.0, alpha: 1.0) // Nextcloud : #0082C9
170171
var customerText: UIColor = .white
171172

172-
var brand: UIColor // don't touch me
173+
@objc var brand: UIColor // don't touch me
173174
var brandElement: UIColor // don't touch me
174175
var brandText: UIColor = UIColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1.0)
175176

@@ -217,7 +218,7 @@ final class NCBrandColor: @unchecked Sendable {
217218
}
218219
}
219220

220-
init() {
221+
override init() {
221222
brand = customer
222223
brandElement = customer
223224
brandText = customerText

Nextcloud.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5215,7 +5215,7 @@
52155215
CODE_SIGN_ENTITLEMENTS = "$(SRCROOT)/Brand/Notification_Service_Extension.entitlements";
52165216
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
52175217
CODE_SIGN_STYLE = Manual;
5218-
CURRENT_PROJECT_VERSION = 3;
5218+
CURRENT_PROJECT_VERSION = 4;
52195219
DEVELOPMENT_TEAM = "";
52205220
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 9FH6TNGWF2;
52215221
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -5248,7 +5248,7 @@
52485248
CODE_SIGN_ENTITLEMENTS = "Notification Service Extension/Notification Service ExtensionRelease.entitlements";
52495249
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
52505250
CODE_SIGN_STYLE = Manual;
5251-
CURRENT_PROJECT_VERSION = 3;
5251+
CURRENT_PROJECT_VERSION = 4;
52525252
DEVELOPMENT_TEAM = "";
52535253
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 9FH6TNGWF2;
52545254
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -5515,7 +5515,7 @@
55155515
CODE_SIGN_ENTITLEMENTS = "$(SRCROOT)/Brand/Share.entitlements";
55165516
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
55175517
CODE_SIGN_STYLE = Manual;
5518-
CURRENT_PROJECT_VERSION = 3;
5518+
CURRENT_PROJECT_VERSION = 4;
55195519
DEVELOPMENT_TEAM = "";
55205520
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 9FH6TNGWF2;
55215521
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -5548,7 +5548,7 @@
55485548
CODE_SIGN_ENTITLEMENTS = Share/ShareRelease.entitlements;
55495549
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
55505550
CODE_SIGN_STYLE = Manual;
5551-
CURRENT_PROJECT_VERSION = 3;
5551+
CURRENT_PROJECT_VERSION = 4;
55525552
DEVELOPMENT_TEAM = "";
55535553
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 9FH6TNGWF2;
55545554
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -5582,7 +5582,7 @@
55825582
CODE_SIGN_ENTITLEMENTS = "$(SRCROOT)/Brand/File_Provider_Extension.entitlements";
55835583
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
55845584
CODE_SIGN_STYLE = Manual;
5585-
CURRENT_PROJECT_VERSION = 3;
5585+
CURRENT_PROJECT_VERSION = 4;
55865586
DEVELOPMENT_TEAM = "";
55875587
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 9FH6TNGWF2;
55885588
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -5618,7 +5618,7 @@
56185618
CODE_SIGN_ENTITLEMENTS = "File Provider Extension/File Provider ExtensionRelease.entitlements";
56195619
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
56205620
CODE_SIGN_STYLE = Manual;
5621-
CURRENT_PROJECT_VERSION = 3;
5621+
CURRENT_PROJECT_VERSION = 4;
56225622
DEVELOPMENT_TEAM = "";
56235623
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 9FH6TNGWF2;
56245624
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -5653,7 +5653,7 @@
56535653
CODE_SIGN_ENTITLEMENTS = "$(SRCROOT)/Brand/iOSClient.entitlements";
56545654
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
56555655
CODE_SIGN_STYLE = Manual;
5656-
CURRENT_PROJECT_VERSION = 3;
5656+
CURRENT_PROJECT_VERSION = 4;
56575657
DEVELOPMENT_TEAM = "";
56585658
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 9FH6TNGWF2;
56595659
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
@@ -5683,7 +5683,7 @@
56835683
CODE_SIGN_ENTITLEMENTS = NextcloudRelease.entitlements;
56845684
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
56855685
CODE_SIGN_STYLE = Manual;
5686-
CURRENT_PROJECT_VERSION = 3;
5686+
CURRENT_PROJECT_VERSION = 4;
56875687
DEVELOPMENT_TEAM = "";
56885688
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 9FH6TNGWF2;
56895689
GCC_SYMBOLS_PRIVATE_EXTERN = YES;

iOSClient/Menu/ContextMenuActions.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ enum ContextMenuActions {
3434

3535
return UIAction(
3636
title: titleDelete,
37-
image: NCUtility().loadImage(named: icon, colors: [color]),
37+
image: NCUtility().loadImage(named: icon, colors: [color]).withTintColor(NCBrandColor.shared.iconImageColor),
3838
attributes: destructive ? [.destructive] : []
3939
) { _ in
4040
let alert = UIAlertController.deleteFileOrFolder(
@@ -112,7 +112,7 @@ enum ContextMenuActions {
112112
completion: (() -> Void)? = nil) -> UIAction {
113113
UIAction(
114114
title: NSLocalizedString("_move_or_copy_", comment: ""),
115-
image: NCUtility().loadImage(named: "move", colors: [NCBrandColor.shared.iconImageColor])//UIImage(systemName: "rectangle.portrait.and.arrow.right")
115+
image: NCUtility().loadImage(named: "move", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor)//UIImage(systemName: "rectangle.portrait.and.arrow.right")
116116
) { _ in
117117
Task { @MainActor in
118118
var fileNameError: NKError?
@@ -149,10 +149,10 @@ enum ContextMenuActions {
149149
let image: UIImage?
150150
if !metadata.canUnlock(as: metadata.userId), isLocked {
151151
titleKey = String(format: NSLocalizedString("_locked_by_", comment: ""), metadata.lockOwnerDisplayName)
152-
image = UIImage(systemName: "lock")
152+
image = UIImage(systemName: "lock")?.withTintColor(NCBrandColor.shared.iconImageColor)
153153
} else {
154154
titleKey = isLocked ? "_unlock_file_" : "_lock_file_"
155-
image = UIImage(systemName: isLocked ? "lock.open" : "lock")
155+
image = UIImage(systemName: isLocked ? "lock.open" : "lock")?.withTintColor(NCBrandColor.shared.iconImageColor)
156156
subtitleKey = !metadata.lockOwnerDisplayName.isEmpty ? String(format: NSLocalizedString("_locked_by_", comment: ""), metadata.lockOwnerDisplayName) : ""
157157
}
158158

iOSClient/Menu/NCCollectionViewCommon+Menu.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ extension NCCollectionViewCommon {
133133
actions.append(
134134
NCMenuAction(
135135
title: NSLocalizedString("_view_in_folder_", comment: ""),
136-
icon: utility.loadImage(named: "arrow.forward.square", colors: [NCBrandColor.shared.iconImageColor]),
136+
icon: utility.loadImage(named: "arrow.forward.square", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor),
137137
order: 21,
138138
sender: sender,
139139
action: { _ in
@@ -165,7 +165,7 @@ extension NCCollectionViewCommon {
165165
actions.append(
166166
NCMenuAction(
167167
title: NSLocalizedString("_e2e_set_folder_encrypted_", comment: ""),
168-
icon: utility.loadImage(named: "lock", colors: [NCBrandColor.shared.iconImageColor]),
168+
icon: utility.loadImage(named: "lock", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor),
169169
order: 30,
170170
sender: sender,
171171
action: { _ in
@@ -188,7 +188,7 @@ extension NCCollectionViewCommon {
188188
actions.append(
189189
NCMenuAction(
190190
title: NSLocalizedString("_e2e_remove_folder_encrypted_", comment: ""),
191-
icon: utility.loadImage(named: "lock", colors: [NCBrandColor.shared.iconImageColor]),
191+
icon: utility.loadImage(named: "lock", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor),
192192
order: 30,
193193
sender: sender,
194194
action: { _ in
@@ -261,7 +261,7 @@ extension NCCollectionViewCommon {
261261
actions.append(
262262
NCMenuAction(
263263
title: NSLocalizedString("_livephoto_save_", comment: ""),
264-
icon: NCUtility().loadImage(named: "livephoto", colors: [NCBrandColor.shared.iconImageColor]),
264+
icon: NCUtility().loadImage(named: "livephoto", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor),
265265
order: 100,
266266
sender: sender,
267267
action: { _ in
@@ -279,7 +279,7 @@ extension NCCollectionViewCommon {
279279
actions.append(
280280
NCMenuAction(
281281
title: NSLocalizedString("_save_as_scan_", comment: ""),
282-
icon: utility.loadImage(named: "doc.viewfinder", colors: [NCBrandColor.shared.iconImageColor]),
282+
icon: utility.loadImage(named: "doc.viewfinder", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor),
283283
order: 110,
284284
sender: sender,
285285
action: { _ in
@@ -316,7 +316,7 @@ extension NCCollectionViewCommon {
316316
actions.append(
317317
NCMenuAction(
318318
title: NSLocalizedString("_rename_", comment: ""),
319-
icon: utility.loadImage(named: "rename", colors: [NCBrandColor.shared.iconImageColor]),
319+
icon: utility.loadImage(named: "rename", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor),
320320
order: 120,
321321
sender: sender,
322322
action: { _ in
@@ -351,7 +351,7 @@ extension NCCollectionViewCommon {
351351
actions.append(
352352
NCMenuAction(
353353
title: NSLocalizedString("_modify_", comment: ""),
354-
icon: utility.loadImage(named: "pencil.tip.crop.circle", colors: [NCBrandColor.shared.iconImageColor]),
354+
icon: utility.loadImage(named: "pencil.tip.crop.circle", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor),
355355
order: 150,
356356
sender: sender,
357357
action: { _ in

iOSClient/Menu/NCContextMenu.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class NCContextMenu: NSObject {
229229
private func makeSetFolderE2EEAction(metadata: tableMetadata) -> UIAction {
230230
return UIAction(
231231
title: NSLocalizedString("_e2e_set_folder_encrypted_", comment: ""),
232-
image: utility.loadImage(named: "lock", colors: [NCBrandColor.shared.iconImageColor])
232+
image: utility.loadImage(named: "lock", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor)
233233
) { _ in
234234
Task {
235235
let error = await NCNetworkingE2EEMarkFolder().markFolderE2ee(
@@ -247,7 +247,7 @@ class NCContextMenu: NSObject {
247247
private func makeUnsetFolderE2EEAction(metadata: tableMetadata) -> UIAction {
248248
return UIAction(
249249
title: NSLocalizedString("_e2e_remove_folder_encrypted_", comment: ""),
250-
image: utility.loadImage(named: "lock", colors: [NCBrandColor.shared.iconImageColor])
250+
image: utility.loadImage(named: "lock", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor)
251251
) { _ in
252252
Task {
253253
let results = await NextcloudKit.shared.markE2EEFolderAsync(
@@ -289,7 +289,7 @@ class NCContextMenu: NSObject {
289289
private func makeSaveAsScanAction(metadata: tableMetadata) -> UIAction {
290290
return UIAction(
291291
title: NSLocalizedString("_save_as_scan_", comment: ""),
292-
image: utility.loadImage(named: "doc.viewfinder", colors: [NCBrandColor.shared.iconImageColor])
292+
image: utility.loadImage(named: "doc.viewfinder", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor)
293293
) { _ in
294294
Task {
295295
if self.utilityFileSystem.fileProviderStorageExists(metadata) {
@@ -322,7 +322,7 @@ class NCContextMenu: NSObject {
322322
private func makeRenameAction(metadata: tableMetadata) -> UIAction {
323323
return UIAction(
324324
title: NSLocalizedString("_rename_", comment: ""),
325-
image: utility.loadImage(named: "rename", colors: [NCBrandColor.shared.iconImageColor])
325+
image: utility.loadImage(named: "rename", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor)
326326
) { _ in
327327
Task { @MainActor in
328328
let capabilities = await NKCapabilities.shared.getCapabilities(for: metadata.account)
@@ -354,7 +354,7 @@ class NCContextMenu: NSObject {
354354
private func makeModifyWithQuickLookAction(metadata: tableMetadata) -> UIAction {
355355
return UIAction(
356356
title: NSLocalizedString("_modify_", comment: ""),
357-
image: utility.loadImage(named: "pencil.tip.crop.circle", colors: [NCBrandColor.shared.iconImageColor])
357+
image: utility.loadImage(named: "pencil.tip.crop.circle", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor)
358358
) { _ in
359359
Task {
360360
if self.utilityFileSystem.fileProviderStorageExists(metadata) {
@@ -387,7 +387,7 @@ class NCContextMenu: NSObject {
387387
private func makeColorFolderAction(metadata: tableMetadata) -> UIAction {
388388
return UIAction(
389389
title: NSLocalizedString("_change_color_", comment: ""),
390-
image: utility.loadImage(named: "paintpalette", colors: [NCBrandColor.shared.iconImageColor])
390+
image: utility.loadImage(named: "paintpalette", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor)
391391
) { _ in
392392
if let picker = UIStoryboard(name: "NCColorPicker", bundle: nil)
393393
.instantiateInitialViewController() as? NCColorPicker {
@@ -414,7 +414,7 @@ class NCContextMenu: NSObject {
414414

415415
let deleteSubMenu = UIMenu(
416416
title: NSLocalizedString("_delete_", comment: ""),
417-
image: utility.loadImage(named: "trashIcon", colors: [NCBrandColor.shared.iconImageColor]),
417+
image: utility.loadImage(named: "trashIcon", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor),
418418
options: .destructive,
419419
children: [deleteConfirmLocal, deleteConfirmFile]
420420
)
@@ -438,7 +438,7 @@ class NCContextMenu: NSObject {
438438
metadata.directory ? "_delete_folder_" : "_delete_file_",
439439
comment: ""
440440
),
441-
image: utility.loadImage(named: "trashIcon", colors: [NCBrandColor.shared.iconImageColor]),
441+
image: utility.loadImage(named: "trashIcon", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor),
442442
attributes: .destructive
443443
) { _ in
444444
if let viewController = self.viewController as? NCCollectionViewCommon {
@@ -460,7 +460,7 @@ class NCContextMenu: NSObject {
460460
private func makeDeleteLocalAction(metadata: tableMetadata) -> UIAction {
461461
return UIAction(
462462
title: NSLocalizedString("_remove_local_file_", comment: ""),
463-
image: utility.loadImage(named: "trashIcon", colors: [NCBrandColor.shared.iconImageColor]),
463+
image: utility.loadImage(named: "trashIcon", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor),
464464
attributes: .destructive
465465
) { _ in
466466
Task {

iOSClient/Menu/NCMenuAction.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ extension NCMenuAction {
9090
static func selectAllAction(sender: Any?, action: @escaping () -> Void) -> NCMenuAction {
9191
NCMenuAction(
9292
title: NSLocalizedString("_select_all_", comment: ""),
93-
icon: NCUtility().loadImage(named: "checkmark.circle.fill", colors: [NCBrandColor.shared.iconImageColor]),
93+
icon: NCUtility().loadImage(named: "checkmark.circle.fill", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor),
9494
sender: sender,
9595
action: { _ in action() }
9696
)
@@ -100,7 +100,7 @@ extension NCMenuAction {
100100
static func cancelAction(sender: Any?, action: @escaping () -> Void) -> NCMenuAction {
101101
NCMenuAction(
102102
title: NSLocalizedString("_cancel_", comment: ""),
103-
icon: NCUtility().loadImage(named: "xmark", colors: [NCBrandColor.shared.iconImageColor]),
103+
icon: NCUtility().loadImage(named: "xmark", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor),
104104
sender: sender,
105105
action: { _ in action() }
106106
)
@@ -151,7 +151,7 @@ extension NCMenuAction {
151151
return NCMenuAction(
152152
title: titleDelete,
153153
destructive: destructive,
154-
icon: NCUtility().loadImage(named: icon, colors: [color]),
154+
icon: NCUtility().loadImage(named: icon, colors: [color]).withTintColor(NCBrandColor.shared.iconImageColor),
155155
order: order,
156156
sender: sender,
157157
action: { _ in
@@ -169,7 +169,7 @@ extension NCMenuAction {
169169
// title: NSLocalizedString("_share_", comment: ""),
170170
// icon: NCUtility().loadImage(named: "share", colors: [NCBrandColor.shared.iconImageColor]),
171171
title: NSLocalizedString("_open_in_", comment: ""),
172-
icon: NCUtility().loadImage(named: "open_file",colors: [NCBrandColor.shared.iconImageColor]),
172+
icon: NCUtility().loadImage(named: "open_file",colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor),
173173
order: order,
174174
sender: sender,
175175
action: { _ in
@@ -185,7 +185,7 @@ extension NCMenuAction {
185185
static func setAvailableOfflineAction(selectedMetadatas: [tableMetadata], isAnyOffline: Bool, viewController: UIViewController, order: Int = 0, sender: Any?, completion: (() -> Void)? = nil) -> NCMenuAction {
186186
NCMenuAction(
187187
title: isAnyOffline ? NSLocalizedString("_remove_available_offline_", comment: "") : NSLocalizedString("_set_available_offline_", comment: ""),
188-
icon: NCUtility().loadImage(named: "cloudDownload", colors: [NCBrandColor.shared.iconImageColor]),
188+
icon: NCUtility().loadImage(named: "cloudDownload", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor),
189189
order: order,
190190
sender: sender,
191191
action: { _ in
@@ -221,7 +221,7 @@ extension NCMenuAction {
221221
static func moveOrCopyAction(selectedMetadatas: [tableMetadata], account: String, viewController: UIViewController, order: Int = 0, sender: Any?, completion: (() -> Void)? = nil) -> NCMenuAction {
222222
NCMenuAction(
223223
title: NSLocalizedString("_move_or_copy_", comment: ""),
224-
icon: NCUtility().loadImage(named: "move", colors: [NCBrandColor.shared.iconImageColor]),
224+
icon: NCUtility().loadImage(named: "move", colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor),
225225
order: order,
226226
sender: sender,
227227
action: { _ in
@@ -263,7 +263,7 @@ extension NCMenuAction {
263263
let imageName = !shouldLock ? "lock_open" : "lock"
264264
return NCMenuAction(
265265
title: NSLocalizedString(titleKey, comment: ""),
266-
icon: NCUtility().loadImage(named: imageName, colors: [NCBrandColor.shared.iconImageColor]),
266+
icon: NCUtility().loadImage(named: imageName, colors: [NCBrandColor.shared.iconImageColor]).withTintColor(NCBrandColor.shared.iconImageColor),
267267
order: order,
268268
sender: sender,
269269
action: { _ in

0 commit comments

Comments
 (0)