mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 21:36:17 +00:00
add an image computed property to hostsymbol to return the Image so it safely returns an image from an sf symbol or an image from an ImageResource
This commit is contained in:
@@ -13,15 +13,9 @@ struct HostSymbolPreview: View {
|
||||
|
||||
var body: some View {
|
||||
ZStack(alignment: .center) {
|
||||
if symbol.isCustom {
|
||||
Image(symbol.sf)
|
||||
.resizable().scaledToFit()
|
||||
.symbolRenderingMode(.monochrome)
|
||||
} else {
|
||||
Image(systemName: symbol.sf)
|
||||
.resizable().scaledToFit()
|
||||
.symbolRenderingMode(.monochrome)
|
||||
}
|
||||
symbol.image
|
||||
.resizable().scaledToFit()
|
||||
.symbolRenderingMode(.monochrome)
|
||||
Text(label)
|
||||
.font(.headline)
|
||||
.offset(symbol.offset)
|
||||
|
||||
Reference in New Issue
Block a user