Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change checkboxes in location cells to the correct ones #6248

Merged
merged 1 commit into from
May 16, 2024
Merged
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
19 changes: 13 additions & 6 deletions ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}()

Expand Down Expand Up @@ -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
Expand Down
Loading