diff --git a/ShhShell/Views/Keys/KeyDetailView.swift b/ShhShell/Views/Keys/KeyDetailView.swift index 09d22b0..6631918 100644 --- a/ShhShell/Views/Keys/KeyDetailView.swift +++ b/ShhShell/Views/Keys/KeyDetailView.swift @@ -110,7 +110,7 @@ struct KeyDetailView: View { VStack(alignment: .leading) { Text("Private key") .bold() - .frame(maxWidth: .infinity) + .multilineTextAlignment(.leading) ZStack(alignment: .center) { Text(keypair.openSshPrivkey.trimmingCharacters(in: .whitespacesAndNewlines)) .blur(radius: reveal ? 0 : 5) diff --git a/ShhShell/Views/Misc/TrafficLights.swift b/ShhShell/Views/Misc/TrafficLights.swift index 9ea7e08..425d6df 100644 --- a/ShhShell/Views/Misc/TrafficLights.swift +++ b/ShhShell/Views/Misc/TrafficLights.swift @@ -8,64 +8,104 @@ import SwiftUI struct TrafficLightRed: View { + let background: Color = .red + let foreground: Color = ColorCodable( + red: 0.5490196078, + green: 0.1019607843, + blue: 0.0588235294 + ).stColor.suiColor + var body: some View { ZStack { Image(systemName: "circle.fill") .resizable().scaledToFit() - .foregroundStyle(.red) + .foregroundStyle(background) Image(systemName: "xmark") .resizable().scaledToFit() .bold() .scaleEffect(0.6) - .foregroundStyle( - ColorCodable( - red: 0.5490196078, - green: 0.1019607843, - blue: 0.0588235294 - ).stColor.suiColor - ) + .foregroundStyle(foreground) } } } struct TrafficLightYellow: View { + let background: Color = .yellow + let foreground: Color = ColorCodable( + red: 0.5803921569, + green: 0.3411764706, + blue: 0.0980392157 + ).stColor.suiColor + var body: some View { ZStack(alignment: .center) { Image(systemName: "circle.fill") .resizable().scaledToFit() - .foregroundStyle(.yellow) + .foregroundStyle(background) Image(systemName: "minus") .resizable().scaledToFit() .bold() - .scaleEffect(0.6) - .foregroundStyle( - ColorCodable( - red: 0.5803921569, - green: 0.3411764706, - blue: 0.0980392157 - ).stColor.suiColor - ) + .scaleEffect(0.7) + .foregroundStyle(foreground) } } } struct TrafficLightGreen: View { + @State var enabled: Bool = true + var body: some View { + let background: Color = .green + let foreground: Color = ColorCodable( + red: 0.1529411765, + green: 0.3843137255, + blue: 0.1176470588 + ).stColor.suiColor ZStack(alignment: .center) { Image(systemName: "circle.fill") .resizable().scaledToFit() .symbolRenderingMode(.palette) - .foregroundStyle(.green) - Rectangle() - .foregroundStyle( - ColorCodable( - red: 0.1529411765, - green: 0.3843137255, - blue: 0.1176470588 - ).stColor.suiColor - ) - .scaleEffect(0.6) - .aspectRatio(1, contentMode: .fit) + .foregroundStyle(background) + if !enabled { + RoundedRectangle(cornerRadius: 5) + .foregroundStyle(foreground) + .scaleEffect(0.6) + .aspectRatio(1, contentMode: .fit) + .clipShape(RoundedRectangle(cornerRadius: 5)) + Rectangle() + .foregroundStyle(background) + .scaleEffect(0.8) + .aspectRatio(0.2, contentMode: .fit) + .rotationEffect(.degrees(45)) + } else { + ZStack(alignment: .center) { + Group { + Rectangle() + .foregroundStyle(foreground) + .scaleEffect(0.6) + .rotationEffect(.degrees(45)) + .aspectRatio(1, contentMode: .fit) + .clipShape(RoundedRectangle(cornerRadius: 5)) + } + VStack(spacing: 0) { + VStack(alignment: .trailing) { + Rectangle() + .scaleEffect(0.7, anchor: .bottomTrailing) + .aspectRatio(1, contentMode: .fit) + } + .aspectRatio(2, contentMode: .fit) + .border(.red) + VStack(alignment: .leading) { + Rectangle() + .scaleEffect(0.7, anchor: .topLeading) + .aspectRatio(1, contentMode: .fit) + } + .aspectRatio(2, contentMode: .fit) + .border(.red) + } + .border(.blue) + } + } } } } diff --git a/ShhShell/Views/Terminal/ShellTabView.swift b/ShhShell/Views/Terminal/ShellTabView.swift index e4f3e68..27afcd2 100644 --- a/ShhShell/Views/Terminal/ShellTabView.swift +++ b/ShhShell/Views/Terminal/ShellTabView.swift @@ -34,35 +34,17 @@ struct ShellTabView: View { session.handler.disconnect() } } label: { - Image(systemName: "xmark.circle.fill") - .resizable().scaledToFit() - .symbolRenderingMode(.palette) - .foregroundStyle( - ColorCodable(red: 0.5411764706, green: 0, blue: 0).stColor.suiColor, - .red - ) + TrafficLightRed() } Button() { dismiss() } label: { - Image(systemName: "minus.circle.fill") - .resizable().scaledToFit() - .symbolRenderingMode(.palette) - .foregroundStyle( - ColorCodable(red: 0.5764705882, green: 0.5333333333, blue: 0.2784313725).stColor.suiColor, - .yellow - ) + TrafficLightYellow() } Button() { print("get out of fullscreen idk??") } label: { - Image(systemName: "minus.circle.fill") - .resizable().scaledToFit() - .symbolRenderingMode(.palette) - .foregroundStyle( - ColorCodable(red: 0.5764705882, green: 0.5333333333, blue: 0.2784313725).stColor.suiColor, - .yellow - ) + TrafficLightGreen() } Spacer() Text(container.sessions[selectedID ?? UUID()]?.handler.title ?? "title")