Skip to content

Commit

Permalink
Apply changes from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
acb-mv committed Nov 15, 2024
1 parent 22d1179 commit 449be37
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,31 @@ struct SingleChoiceList<Item>: View where Item: Hashable {
func row(_ v: Item) -> some View {
let isSelected = value.wrappedValue == v
return HStack {
Image("IconTick").opacity(isSelected ? 1.0 : 0.0)
Image(uiImage: UIImage(resource: .iconTick)).opacity(isSelected ? 1.0 : 0.0)
Spacer().frame(width: UIMetrics.SettingsCell.selectableSettingsCellLeftViewSpacing)
Text(verbatim: itemDescription(v))
Spacer()
}
.padding(16)
.background(isSelected ? Color(UIColor.Cell.Background.selected) : Color(UIColor.Cell.Background.normal))
.padding(EdgeInsets(UIMetrics.SettingsCell.layoutMargins))
.background(
isSelected
? Color(UIColor.Cell.Background.selected)
: Color(UIColor.Cell.Background.indentationLevelOne)
)
.foregroundColor(Color(UIColor.Cell.titleTextColor))
.onTapGesture {
value.wrappedValue = v
}
}

var body: some View {
VStack(spacing: 0) {
VStack(spacing: UIMetrics.TableView.separatorHeight) {
HStack {
Text(title).fontWeight(.semibold)
Spacer()
}
.padding(EdgeInsets(UIMetrics.SettingsCell.layoutMargins))
.background(Color(UIColor.Cell.Background.normal))
ForEach(options, id: \.self) { opt in
row(opt)
}
Expand Down

0 comments on commit 449be37

Please sign in to comment.