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() canvas.locksCanvas.toggle()
} }
} label: { } label: {
ZStack { Image(systemName: canvas.locksCanvas ? "lock.fill" : "lock.open.fill")
if canvas.locksCanvas { .contentShape(.circle)
Image(systemName: "lock.open") .frame(width: size, height: size)
.transition(.move(edge: .trailing).combined(with: .blurReplace)) .background(.regularMaterial)
} else { .clipShape(.rect(cornerRadius: 8))
Image(systemName: "lock")
.transition(.move(edge: .leading).combined(with: .blurReplace))
}
}
.contentShape(.circle)
.frame(width: size, height: size)
.background(.regularMaterial)
.clipShape(.rect(cornerRadius: 8))
} }
.hoverEffect(.lift) .hoverEffect(.lift)
.contentTransition(.symbolEffect(.replace))
} }
} }