Skip to content

Commit

Permalink
Change checkboxes in location cells to the correct ones
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Petersson committed May 13, 2024
1 parent c828a96 commit e7b42db
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 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 @@ -314,8 +318,11 @@ extension LocationCell {
showsCollapseControl = !item.node.children.isEmpty
isExpanded = item.node.showsChildren
checkboxButton.accessibilityIdentifier = .customListLocationCheckmarkButton
checkboxButton.isSelected = item.isSelected
checkboxButton.tintColor = item.isSelected ? .successColor : .white

for view in checkboxButton.subviews where view is CheckboxView {
let checkboxView = view as? CheckboxView
checkboxView?.isChecked = item.isSelected
}

if item.node is CountryLocationNode {
accessibilityIdentifier = .countryLocationCell
Expand Down

0 comments on commit e7b42db

Please sign in to comment.