Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions iOSClient/Files/NCFiles.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +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)
self.mainNavigationController?.menuPlusButton.tintColor = .white
// re-tint the + button
self.mainNavigationController?.menuPlusButton.setPlusButtonColor(NCBrandColor.shared.getElement(account: account))
}
}
}
Expand Down Expand Up @@ -64,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)
Expand Down Expand Up @@ -144,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)
}
}

Expand Down
42 changes: 30 additions & 12 deletions iOSClient/Main/NCMainNavigationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: "")
Expand Down Expand Up @@ -443,3 +450,14 @@ class NCMainNavigationController: UINavigationController, UINavigationController
}
}
}

extension UIButton {
func setPlusButtonColor(_ color: UIColor) {
if #available(iOS 26.0, *) {
tintColor = color
} else {
Comment thread
mpivchev marked this conversation as resolved.
backgroundColor = color
tintColor = .white
}
}
}
Comment thread
mpivchev marked this conversation as resolved.
3 changes: 1 addition & 2 deletions iOSClient/Menu/NCContextMenuPlus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading