Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 0 additions & 1 deletion iOSClient/Files/NCFiles.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
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