From 0c186189d92a632f06291cc50c40fcb04b5cb26a Mon Sep 17 00:00:00 2001 From: Milen Pivchev Date: Fri, 17 Jul 2026 13:55:11 +0200 Subject: [PATCH 1/3] WIP Signed-off-by: Milen Pivchev --- iOSClient/Files/NCFiles.swift | 9 ++-- .../Main/NCMainNavigationController.swift | 42 +++++++++++++------ iOSClient/Menu/NCContextMenuPlus.swift | 3 +- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/iOSClient/Files/NCFiles.swift b/iOSClient/Files/NCFiles.swift index e1acc03cf0..b2e5205c97 100644 --- a/iOSClient/Files/NCFiles.swift +++ b/iOSClient/Files/NCFiles.swift @@ -33,8 +33,7 @@ class NCFiles: NCCollectionViewCommon { if let userInfo = notification.userInfo, let account = userInfo["account"] as? String, self.controller?.account == account { - self.mainNavigationController?.menuPlusButton.backgroundColor = NCBrandColor.shared.getElement(account: account) - self.mainNavigationController?.menuPlusButton.tintColor = .white + self.mainNavigationController?.menuPlusButton.setPlusButtonColor(NCBrandColor.shared.getElement(account: account)) } } } @@ -63,8 +62,7 @@ class NCFiles: NCCollectionViewCommon { } if let userInfo = notification.userInfo, let account = userInfo["account"] as? String { - self.mainNavigationController?.menuPlusButton.backgroundColor = NCBrandColor.shared.getElement(account: account) - self.mainNavigationController?.menuPlusButton.tintColor = .white + self.mainNavigationController?.menuPlusButton.setPlusButtonColor(NCBrandColor.shared.getElement(account: account)) } self.navigationController?.popToRootViewController(animated: false) @@ -144,8 +142,7 @@ class NCFiles: NCCollectionViewCommon { if let menuPlusButton = self.mainNavigationController?.menuPlusButton { menuPlusButton.isEnabled = metadataFolder.isCreatable - menuPlusButton.backgroundColor = metadataFolder.isCreatable ? color : .lightGray - menuPlusButton.tintColor = .white + menuPlusButton.setPlusButtonColor(metadataFolder.isCreatable ? color : .lightGray) } } diff --git a/iOSClient/Main/NCMainNavigationController.swift b/iOSClient/Main/NCMainNavigationController.swift index 3c03ed5fa9..98fca7d6a6 100644 --- a/iOSClient/Main/NCMainNavigationController.swift +++ b/iOSClient/Main/NCMainNavigationController.swift @@ -116,19 +116,26 @@ class NCMainNavigationController: UINavigationController, UINavigationController // PLUS BUTTON MENU let buttonSize: CGFloat = 44 - let plusConfiguration = UIImage.SymbolConfiguration(pointSize: 22, weight: .regular) + let plusConfiguration = UIImage.SymbolConfiguration(pointSize: 18, weight: .regular) let plusImage = UIImage(systemName: "plus", withConfiguration: plusConfiguration)?.withRenderingMode(.alwaysTemplate) - menuPlusButton.setImage(plusImage, for: .normal) - menuPlusButton.tintColor = .white - menuPlusButton.contentHorizontalAlignment = .center - menuPlusButton.contentVerticalAlignment = .center - menuPlusButton.backgroundColor = NCBrandColor.shared.getElement(account: session.account) - menuPlusButton.layer.cornerRadius = buttonSize / 2 - menuPlusButton.layer.masksToBounds = false - menuPlusButton.layer.shadowColor = UIColor.black.cgColor - menuPlusButton.layer.shadowOpacity = 0.18 - menuPlusButton.layer.shadowRadius = 8 - menuPlusButton.layer.shadowOffset = CGSize(width: 0, height: 4) + + if #available(iOS 26.0, *) { + var glassConfiguration = UIButton.Configuration.prominentGlass() + glassConfiguration.image = plusImage + menuPlusButton.configuration = glassConfiguration + } else { + menuPlusButton.setImage(plusImage, for: .normal) + menuPlusButton.contentHorizontalAlignment = .center + menuPlusButton.contentVerticalAlignment = .center + menuPlusButton.layer.cornerRadius = buttonSize / 2 + menuPlusButton.layer.masksToBounds = false + menuPlusButton.layer.shadowColor = UIColor.black.cgColor + menuPlusButton.layer.shadowOpacity = 0.18 + menuPlusButton.layer.shadowRadius = 8 + menuPlusButton.layer.shadowOffset = CGSize(width: 0, height: 4) + } + + menuPlusButton.setPlusButtonColor(NCBrandColor.shared.getElement(account: session.account)) menuPlusButton.showsMenuAsPrimaryAction = true menuPlusButton.translatesAutoresizingMaskIntoConstraints = false menuPlusButton.accessibilityLabel = NSLocalizedString("_add_", comment: "") @@ -438,3 +445,14 @@ class NCMainNavigationController: UINavigationController, UINavigationController } } } + +extension UIButton { + func setPlusButtonColor(_ color: UIColor) { + if #available(iOS 26.0, *) { + tintColor = color + } else { + backgroundColor = color + tintColor = .white + } + } +} diff --git a/iOSClient/Menu/NCContextMenuPlus.swift b/iOSClient/Menu/NCContextMenuPlus.swift index a237728882..6db7f5f0ac 100644 --- a/iOSClient/Menu/NCContextMenuPlus.swift +++ b/iOSClient/Menu/NCContextMenuPlus.swift @@ -434,8 +434,7 @@ class NCContextMenuPlus: NSObject { menuPlusButton.menu = plusMenu menuPlusButton.showsMenuAsPrimaryAction = true - menuPlusButton.backgroundColor = NCBrandColor.shared.getElement(account: session.account) - menuPlusButton.tintColor = .white + menuPlusButton.setPlusButtonColor(NCBrandColor.shared.getElement(account: session.account)) menuPlusButton.alpha = 1 // E2EE Offline disable From b11edf4454e572bb10ca5fe06eaa546b02cb6529 Mon Sep 17 00:00:00 2001 From: Marino Faggiana Date: Sat, 18 Jul 2026 07:55:06 +0200 Subject: [PATCH 2/3] fix: preserve plus button tint on account changes Signed-off-by: Marino Faggiana --- iOSClient/Files/NCFiles.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/iOSClient/Files/NCFiles.swift b/iOSClient/Files/NCFiles.swift index 43278c91f9..2bef64018a 100644 --- a/iOSClient/Files/NCFiles.swift +++ b/iOSClient/Files/NCFiles.swift @@ -35,7 +35,6 @@ class NCFiles: NCCollectionViewCommon { self.controller?.account == account { // (+) self.mainNavigationController?.menuPlusButton.backgroundColor = NCBrandColor.shared.getElement(account: account) - self.mainNavigationController?.menuPlusButton.tintColor = .white } } } From 17823640f636fff85d263f507e454f1185706bb2 Mon Sep 17 00:00:00 2001 From: Milen Pivchev Date: Mon, 20 Jul 2026 11:20:41 +0200 Subject: [PATCH 3/3] WIP Signed-off-by: Milen Pivchev --- iOSClient/Files/NCFiles.swift | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/iOSClient/Files/NCFiles.swift b/iOSClient/Files/NCFiles.swift index 2bef64018a..def75aab30 100644 --- a/iOSClient/Files/NCFiles.swift +++ b/iOSClient/Files/NCFiles.swift @@ -33,8 +33,8 @@ class NCFiles: NCCollectionViewCommon { if let userInfo = notification.userInfo, let account = userInfo["account"] as? String, self.controller?.account == account { - // (+) - self.mainNavigationController?.menuPlusButton.backgroundColor = NCBrandColor.shared.getElement(account: account) + // re-tint the + button + self.mainNavigationController?.menuPlusButton.setPlusButtonColor(NCBrandColor.shared.getElement(account: account)) } } } @@ -63,9 +63,8 @@ class NCFiles: NCCollectionViewCommon { } if let userInfo = notification.userInfo, let account = userInfo["account"] as? String { - // (+) - self.mainNavigationController?.menuPlusButton.backgroundColor = NCBrandColor.shared.getElement(account: account) - self.mainNavigationController?.menuPlusButton.tintColor = .white + // re-tint the + button for the new account + self.mainNavigationController?.menuPlusButton.setPlusButtonColor(NCBrandColor.shared.getElement(account: account)) } self.navigationController?.popToRootViewController(animated: false) @@ -143,11 +142,9 @@ class NCFiles: NCCollectionViewCommon { // disable + button if no create permission let color = NCBrandColor.shared.getElement(account: self.session.account) - // (+) if let menuPlusButton = self.mainNavigationController?.menuPlusButton { menuPlusButton.isEnabled = metadataFolder.isCreatable - menuPlusButton.backgroundColor = metadataFolder.isCreatable ? color : .lightGray - menuPlusButton.tintColor = .white + menuPlusButton.setPlusButtonColor(metadataFolder.isCreatable ? color : .lightGray) } }