mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 05:19:13 +00:00
- animations!! symbol preview doesnt have a glow if its "small" added a blur on connectionview if the symbol picker popover is visible - need to figure out how to animate it dipping
44 lines
844 B
Swift
44 lines
844 B
Swift
//
|
|
// HostSymbolPreview.swift
|
|
// ShhShell
|
|
//
|
|
// Created by neon443 on 26/06/2025.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct HostSymbolPreview: View {
|
|
@State var symbol: HostSymbol
|
|
@State var label: String
|
|
@State var small: Bool = false
|
|
|
|
var body: some View {
|
|
if small {
|
|
HStack(alignment: .center, spacing: 5) {
|
|
Text(label)
|
|
.font(.headline)
|
|
symbol.image
|
|
.resizable().scaledToFit()
|
|
.symbolRenderingMode(.monochrome)
|
|
}
|
|
} else {
|
|
ZStack(alignment: .center) {
|
|
symbol.image
|
|
.resizable().scaledToFit()
|
|
.symbolRenderingMode(.monochrome)
|
|
.blur(radius: 1)
|
|
symbol.image
|
|
.resizable().scaledToFit()
|
|
.symbolRenderingMode(.monochrome)
|
|
Text(label)
|
|
.font(.headline)
|
|
.offset(symbol.offset)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
HostSymbolPreview(symbol: HostSymbol.desktopcomputer, label: "lo0")
|
|
}
|