mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
added traffliclights to make the traffic lights perfect, red yellow done
green wip clean up on the terminal view: add background and reorg the fiel and add traffic lights add bg to all the terminal related stuff
This commit is contained in:
@@ -49,6 +49,7 @@
|
|||||||
A96C6B022E0C49E800F377FE /* CenteredLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A96C6B012E0C49E800F377FE /* CenteredLabel.swift */; };
|
A96C6B022E0C49E800F377FE /* CenteredLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A96C6B012E0C49E800F377FE /* CenteredLabel.swift */; };
|
||||||
A96C90A12E12B87A00724253 /* TextBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = A96C90A02E12B87900724253 /* TextBox.swift */; };
|
A96C90A12E12B87A00724253 /* TextBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = A96C90A02E12B87900724253 /* TextBox.swift */; };
|
||||||
A96C90A32E12D53B00724253 /* KeyType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A96C90A22E12D53900724253 /* KeyType.swift */; };
|
A96C90A32E12D53B00724253 /* KeyType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A96C90A22E12D53900724253 /* KeyType.swift */; };
|
||||||
|
A9835C3C2E17CCA500969508 /* TrafficLights.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9835C3B2E17CCA500969508 /* TrafficLights.swift */; };
|
||||||
A98554552E05535F009051BD /* KeyManagerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98554542E05535F009051BD /* KeyManagerView.swift */; };
|
A98554552E05535F009051BD /* KeyManagerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98554542E05535F009051BD /* KeyManagerView.swift */; };
|
||||||
A98554592E0553AA009051BD /* KeyManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98554582E0553AA009051BD /* KeyManager.swift */; };
|
A98554592E0553AA009051BD /* KeyManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98554582E0553AA009051BD /* KeyManager.swift */; };
|
||||||
A985545D2E055D4D009051BD /* ConnectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A985545C2E055D4D009051BD /* ConnectionView.swift */; };
|
A985545D2E055D4D009051BD /* ConnectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A985545C2E055D4D009051BD /* ConnectionView.swift */; };
|
||||||
@@ -154,6 +155,7 @@
|
|||||||
A96C6B012E0C49E800F377FE /* CenteredLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CenteredLabel.swift; sourceTree = "<group>"; };
|
A96C6B012E0C49E800F377FE /* CenteredLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CenteredLabel.swift; sourceTree = "<group>"; };
|
||||||
A96C90A02E12B87900724253 /* TextBox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextBox.swift; sourceTree = "<group>"; };
|
A96C90A02E12B87900724253 /* TextBox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextBox.swift; sourceTree = "<group>"; };
|
||||||
A96C90A22E12D53900724253 /* KeyType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyType.swift; sourceTree = "<group>"; };
|
A96C90A22E12D53900724253 /* KeyType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyType.swift; sourceTree = "<group>"; };
|
||||||
|
A9835C3B2E17CCA500969508 /* TrafficLights.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrafficLights.swift; sourceTree = "<group>"; };
|
||||||
A98554542E05535F009051BD /* KeyManagerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyManagerView.swift; sourceTree = "<group>"; };
|
A98554542E05535F009051BD /* KeyManagerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyManagerView.swift; sourceTree = "<group>"; };
|
||||||
A98554582E0553AA009051BD /* KeyManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyManager.swift; sourceTree = "<group>"; };
|
A98554582E0553AA009051BD /* KeyManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyManager.swift; sourceTree = "<group>"; };
|
||||||
A985545C2E055D4D009051BD /* ConnectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionView.swift; sourceTree = "<group>"; };
|
A985545C2E055D4D009051BD /* ConnectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionView.swift; sourceTree = "<group>"; };
|
||||||
@@ -355,6 +357,7 @@
|
|||||||
A93143C52DF61FE300FCD5DB /* ViewModifiers.swift */,
|
A93143C52DF61FE300FCD5DB /* ViewModifiers.swift */,
|
||||||
A96C90A02E12B87900724253 /* TextBox.swift */,
|
A96C90A02E12B87900724253 /* TextBox.swift */,
|
||||||
A9DA97722E0D40C100142DDC /* HostSymbolPreview.swift */,
|
A9DA97722E0D40C100142DDC /* HostSymbolPreview.swift */,
|
||||||
|
A9835C3B2E17CCA500969508 /* TrafficLights.swift */,
|
||||||
);
|
);
|
||||||
path = Misc;
|
path = Misc;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -604,6 +607,7 @@
|
|||||||
A9D819292E0E904200442D38 /* Theme.swift in Sources */,
|
A9D819292E0E904200442D38 /* Theme.swift in Sources */,
|
||||||
A9D8192D2E0E9EB500442D38 /* ThemeManagerView.swift in Sources */,
|
A9D8192D2E0E9EB500442D38 /* ThemeManagerView.swift in Sources */,
|
||||||
A9FD375D2E143D7E005319A8 /* KeyStoreError.swift in Sources */,
|
A9FD375D2E143D7E005319A8 /* KeyStoreError.swift in Sources */,
|
||||||
|
A9835C3C2E17CCA500969508 /* TrafficLights.swift in Sources */,
|
||||||
A93143C62DF61FE300FCD5DB /* ViewModifiers.swift in Sources */,
|
A93143C62DF61FE300FCD5DB /* ViewModifiers.swift in Sources */,
|
||||||
A98554632E0587DF009051BD /* HostsView.swift in Sources */,
|
A98554632E0587DF009051BD /* HostsView.swift in Sources */,
|
||||||
A96C6A8A2E0C0B1100F377FE /* SSHState.swift in Sources */,
|
A96C6A8A2E0C0B1100F377FE /* SSHState.swift in Sources */,
|
||||||
|
|||||||
83
ShhShell/Views/Misc/TrafficLights.swift
Normal file
83
ShhShell/Views/Misc/TrafficLights.swift
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
//
|
||||||
|
// TrafficLights.swift
|
||||||
|
// ShhShell
|
||||||
|
//
|
||||||
|
// Created by neon443 on 04/07/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct TrafficLightRed: View {
|
||||||
|
var body: some View {
|
||||||
|
ZStack {
|
||||||
|
Image(systemName: "circle.fill")
|
||||||
|
.resizable().scaledToFit()
|
||||||
|
.foregroundStyle(.red)
|
||||||
|
Image(systemName: "xmark")
|
||||||
|
.resizable().scaledToFit()
|
||||||
|
.bold()
|
||||||
|
.scaleEffect(0.6)
|
||||||
|
.foregroundStyle(
|
||||||
|
ColorCodable(
|
||||||
|
red: 0.5490196078,
|
||||||
|
green: 0.1019607843,
|
||||||
|
blue: 0.0588235294
|
||||||
|
).stColor.suiColor
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct TrafficLightYellow: View {
|
||||||
|
var body: some View {
|
||||||
|
ZStack(alignment: .center) {
|
||||||
|
Image(systemName: "circle.fill")
|
||||||
|
.resizable().scaledToFit()
|
||||||
|
.foregroundStyle(.yellow)
|
||||||
|
Image(systemName: "minus")
|
||||||
|
.resizable().scaledToFit()
|
||||||
|
.bold()
|
||||||
|
.scaleEffect(0.6)
|
||||||
|
.foregroundStyle(
|
||||||
|
ColorCodable(
|
||||||
|
red: 0.5803921569,
|
||||||
|
green: 0.3411764706,
|
||||||
|
blue: 0.0980392157
|
||||||
|
).stColor.suiColor
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct TrafficLightGreen: View {
|
||||||
|
var body: some View {
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Preview {
|
||||||
|
Group {
|
||||||
|
HStack {
|
||||||
|
TrafficLightRed()
|
||||||
|
TrafficLightYellow()
|
||||||
|
TrafficLightGreen()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.frame(width: 150, height: 50)
|
||||||
|
.scaleEffect(4.9)
|
||||||
|
}
|
||||||
@@ -19,8 +19,8 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
|
|||||||
self.handler = handler
|
self.handler = handler
|
||||||
self.hostsManager = hostsManager
|
self.hostsManager = hostsManager
|
||||||
|
|
||||||
print(getTerminal().backgroundColor)
|
print(getTerminal().backgroundColor.colorCodable)
|
||||||
print(getTerminal().foregroundColor)
|
print(getTerminal().foregroundColor.colorCodable)
|
||||||
|
|
||||||
applySelectedTheme()
|
applySelectedTheme()
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,18 @@ struct ShellTabView: View {
|
|||||||
|
|
||||||
@Environment(\.dismiss) var dismiss
|
@Environment(\.dismiss) var dismiss
|
||||||
|
|
||||||
|
var foreground: Color { hostsManager.selectedTheme.foreground.suiColor }
|
||||||
|
var ansi7: Color { hostsManager.selectedTheme.ansi[6].suiColor.opacity(0.7) }
|
||||||
|
var background: Color { hostsManager.selectedTheme.background.suiColor }
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
ZStack {
|
||||||
|
background
|
||||||
|
.ignoresSafeArea(.all)
|
||||||
GeometryReader { geo in
|
GeometryReader { geo in
|
||||||
VStack {
|
VStack {
|
||||||
|
let oneTabWidth = max(60, (geo.size.width)/CGFloat(container.sessionIDs.count))
|
||||||
|
|
||||||
HStack(alignment: .center, spacing: 10) {
|
HStack(alignment: .center, spacing: 10) {
|
||||||
Button() {
|
Button() {
|
||||||
for session in container.sessions.values {
|
for session in container.sessions.values {
|
||||||
@@ -44,22 +53,29 @@ struct ShellTabView: View {
|
|||||||
.yellow
|
.yellow
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
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
|
||||||
|
)
|
||||||
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
Text(container.sessions[selectedID ?? UUID()]?.handler.title ?? "title")
|
Text(container.sessions[selectedID ?? UUID()]?.handler.title ?? "title")
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
.frame(height: 30)
|
.frame(height: 30)
|
||||||
.padding(10)
|
.padding(.horizontal)
|
||||||
|
|
||||||
let oneTabWidth = max(60, (geo.size.width-35)/CGFloat(container.sessionIDs.count))
|
|
||||||
HStack(alignment: .center, spacing: 0) {
|
HStack(alignment: .center, spacing: 0) {
|
||||||
ScrollView(.horizontal, showsIndicators: false) {
|
ScrollView(.horizontal, showsIndicators: false) {
|
||||||
HStack(spacing: 0) {
|
HStack(spacing: 0) {
|
||||||
ForEach(container.sessionIDs, id: \.self) { id in
|
ForEach(container.sessionIDs, id: \.self) { id in
|
||||||
let selected = selectedID == id
|
let selected: Bool = selectedID == id
|
||||||
let foreground = hostsManager.selectedTheme.foreground.suiColor
|
|
||||||
let ansi7 = hostsManager.selectedTheme.ansi[6].suiColor.opacity(0.7)
|
|
||||||
let background = hostsManager.selectedTheme.background.suiColor
|
|
||||||
ZStack {
|
ZStack {
|
||||||
Rectangle()
|
Rectangle()
|
||||||
.fill(selected ? ansi7 : background)
|
.fill(selected ? ansi7 : background)
|
||||||
@@ -79,22 +95,12 @@ struct ShellTabView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(width: oneTabWidth)
|
.frame(width: oneTabWidth)
|
||||||
.ignoresSafeArea(.all)
|
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
withAnimation { selectedID = id }
|
withAnimation { selectedID = id }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Button() {
|
|
||||||
dismiss()
|
|
||||||
} label: {
|
|
||||||
Image(systemName: "arrow.down.right.and.arrow.up.left")
|
|
||||||
.resizable().scaledToFit()
|
|
||||||
}
|
|
||||||
.buttonStyle(.plain)
|
|
||||||
.frame(width: 30)
|
|
||||||
.padding(.horizontal, 2.5)
|
|
||||||
}
|
}
|
||||||
.frame(height: 30)
|
.frame(height: 30)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
@@ -107,6 +113,7 @@ struct ShellTabView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//the acc terminal lol
|
||||||
if let selectedID,
|
if let selectedID,
|
||||||
let session = container.sessions[selectedID] {
|
let session = container.sessions[selectedID] {
|
||||||
ShellView(
|
ShellView(
|
||||||
@@ -134,6 +141,7 @@ struct ShellTabView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ struct ShellView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationStack {
|
NavigationStack {
|
||||||
ZStack {
|
ZStack {
|
||||||
|
hostsManager.selectedTheme.background.suiColor
|
||||||
|
.ignoresSafeArea(.all)
|
||||||
TerminalController(handler: handler, hostsManager: hostsManager)
|
TerminalController(handler: handler, hostsManager: hostsManager)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
if let sessionID = handler.sessionID {
|
if let sessionID = handler.sessionID {
|
||||||
|
|||||||
Reference in New Issue
Block a user