diff options
| author | Jon Petersson <jon.petersson@kvadrat.se> | 2024-05-13 16:43:14 +0200 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2024-05-16 15:06:52 +0200 |
| commit | 199f0070b7bfe9f41439e98997ee4b02a3699e18 (patch) | |
| tree | 1fa71190ae7dba64ce17e6d49efd23d285197269 | |
| parent | 5ae06f250c947dc27385b3e98bc1a93597045012 (diff) | |
| download | mullvadvpn-199f0070b7bfe9f41439e98997ee4b02a3699e18.tar.xz mullvadvpn-199f0070b7bfe9f41439e98997ee4b02a3699e18.zip | |
Change checkboxes in location cells to the correct ones
| -rw-r--r-- | ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift b/ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift index 68c70b04cc..4f2f5ab62c 100644 --- a/ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift +++ b/ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift @@ -40,9 +40,13 @@ class LocationCell: UITableViewCell { private let checkboxButton: UIButton = { let button = UIButton() - button.setImage(UIImage(systemName: "checkmark.square.fill"), for: .selected) - button.setImage(UIImage(systemName: "square"), for: .normal) - button.tintColor = .white + let checkboxView = CheckboxView() + + checkboxView.isUserInteractionEnabled = false + button.addConstrainedSubviews([checkboxView]) { + checkboxView.pinEdgesToSuperviewMargins(PinnableEdges([.top(8), .bottom(8), .leading(16), .trailing(16)])) + } + return button }() @@ -310,10 +314,13 @@ extension LocationCell { locationLabel.text = item.node.name showsCollapseControl = !item.node.children.isEmpty isExpanded = item.node.showsChildren - checkboxButton.accessibilityIdentifier = .customListLocationCheckmarkButton - checkboxButton.isSelected = item.isSelected - checkboxButton.tintColor = item.isSelected ? .successColor : .white accessibilityValue = item.node.code + checkboxButton.accessibilityIdentifier = .customListLocationCheckmarkButton + + for view in checkboxButton.subviews where view is CheckboxView { + let checkboxView = view as? CheckboxView + checkboxView?.isChecked = item.isSelected + } if item.node is CustomListLocationNode { accessibilityIdentifier = .customListLocationCell |
