Improve page indicators, adding items

This commit is contained in:
Christoph Hagen
2025-01-09 13:27:38 +01:00
parent 0590224f02
commit 0db6e411c3
23 changed files with 238 additions and 206 deletions

View File

@ -8,15 +8,38 @@ struct FileToAddView: View {
let delete: (FileToAdd) -> Void
var symbol: SFSymbol {
if file.idAlreadyExists {
return .docOnDoc
}
if file.isSelected {
return .checkmarkCircleFill
}
return .circle
}
var color: Color {
if file.idAlreadyExists {
return .red
}
if file.isSelected {
return .blue
}
return .gray
}
var body: some View {
VStack(alignment: .leading) {
HStack {
Image(systemSymbol: file.isSelected ? .checkmarkCircleFill : .circle)
Image(systemSymbol: symbol)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 20, height: 20)
.foregroundStyle(.blue)
.foregroundStyle(color)
.onTapGesture {
file.isSelected.toggle()
if !file.idAlreadyExists {
file.isSelected.toggle()
}
}
Image(systemSymbol: .trashCircleFill)
.resizable()