feat: add symbol effect to lock button

This commit is contained in:
dscyrescotti
2024-06-24 21:01:12 +07:00
parent f85610a99b
commit cfa177f3f3

View File

@@ -323,20 +323,13 @@ struct PenDock: View {
canvas.locksCanvas.toggle()
}
} label: {
ZStack {
if canvas.locksCanvas {
Image(systemName: "lock.open")
.transition(.move(edge: .trailing).combined(with: .blurReplace))
} else {
Image(systemName: "lock")
.transition(.move(edge: .leading).combined(with: .blurReplace))
}
}
.contentShape(.circle)
.frame(width: size, height: size)
.background(.regularMaterial)
.clipShape(.rect(cornerRadius: 8))
Image(systemName: canvas.locksCanvas ? "lock.fill" : "lock.open.fill")
.contentShape(.circle)
.frame(width: size, height: size)
.background(.regularMaterial)
.clipShape(.rect(cornerRadius: 8))
}
.hoverEffect(.lift)
.contentTransition(.symbolEffect(.replace))
}
}