mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
simplified the red&yellow traffic lights
removed the green one idk what to do w it improved teh lights themselves, they have equal spacing on all sides, including padding fixed background of the titlebar/trafffic light header hide the session title in the tab if its active if not active show it ANIMATIONS!
This commit is contained in:
@@ -16,16 +16,10 @@ struct TrafficLightRed: View {
|
|||||||
).stColor.suiColor
|
).stColor.suiColor
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack {
|
Image(systemName: "xmark.circle.fill")
|
||||||
Image(systemName: "circle.fill")
|
|
||||||
.resizable().scaledToFit()
|
.resizable().scaledToFit()
|
||||||
.foregroundStyle(background)
|
.symbolRenderingMode(.palette)
|
||||||
Image(systemName: "xmark")
|
.foregroundStyle(foreground, background)
|
||||||
.resizable().scaledToFit()
|
|
||||||
.bold()
|
|
||||||
.scaleEffect(0.6)
|
|
||||||
.foregroundStyle(foreground)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,16 +32,10 @@ struct TrafficLightYellow: View {
|
|||||||
).stColor.suiColor
|
).stColor.suiColor
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack(alignment: .center) {
|
Image(systemName: "minus.circle.fill")
|
||||||
Image(systemName: "circle.fill")
|
|
||||||
.resizable().scaledToFit()
|
.resizable().scaledToFit()
|
||||||
.foregroundStyle(background)
|
.symbolRenderingMode(.palette)
|
||||||
Image(systemName: "minus")
|
.foregroundStyle(foreground, background)
|
||||||
.resizable().scaledToFit()
|
|
||||||
.bold()
|
|
||||||
.scaleEffect(0.7)
|
|
||||||
.foregroundStyle(foreground)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
|
|||||||
while handler.connected {
|
while handler.connected {
|
||||||
if let read = handler.readFromChannel() {
|
if let read = handler.readFromChannel() {
|
||||||
await MainActor.run {
|
await MainActor.run {
|
||||||
|
print(read)
|
||||||
self.feed(text: read)
|
self.feed(text: read)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -48,6 +49,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
|
|||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
|
||||||
self.getTerminal().resetToInitialState()
|
self.getTerminal().resetToInitialState()
|
||||||
for line in scrollback {
|
for line in scrollback {
|
||||||
|
print(line)
|
||||||
self.feed(text: line)
|
self.feed(text: line)
|
||||||
}
|
}
|
||||||
self.setNeedsLayout()
|
self.setNeedsLayout()
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ struct ShellTabView: View {
|
|||||||
background
|
background
|
||||||
.ignoresSafeArea(.all)
|
.ignoresSafeArea(.all)
|
||||||
GeometryReader { geo in
|
GeometryReader { geo in
|
||||||
VStack {
|
VStack(spacing: 0) {
|
||||||
let oneTabWidth = max(60, (geo.size.width)/CGFloat(container.sessionIDs.count))
|
let oneTabWidth = max(60, (geo.size.width)/CGFloat(container.sessionIDs.count))
|
||||||
|
|
||||||
HStack(alignment: .center, spacing: 10) {
|
HStack(alignment: .center, spacing: 10) {
|
||||||
@@ -41,17 +41,16 @@ struct ShellTabView: View {
|
|||||||
} label: {
|
} label: {
|
||||||
TrafficLightYellow()
|
TrafficLightYellow()
|
||||||
}
|
}
|
||||||
Button() {
|
|
||||||
print("get out of fullscreen idk??")
|
|
||||||
} label: {
|
|
||||||
TrafficLightGreen()
|
|
||||||
}
|
|
||||||
Spacer()
|
Spacer()
|
||||||
Text(container.sessions[selectedID ?? UUID()]?.handler.title ?? "title")
|
Text(container.sessions[selectedID ?? UUID()]?.handler.title ?? "title")
|
||||||
|
.bold()
|
||||||
|
.monospaced()
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
|
.padding(.horizontal, 10)
|
||||||
|
.padding(.bottom, 10)
|
||||||
|
.background(ansi7, ignoresSafeAreaEdges: .all)
|
||||||
.frame(height: 30)
|
.frame(height: 30)
|
||||||
.padding(.horizontal)
|
|
||||||
|
|
||||||
HStack(alignment: .center, spacing: 0) {
|
HStack(alignment: .center, spacing: 0) {
|
||||||
ScrollView(.horizontal, showsIndicators: false) {
|
ScrollView(.horizontal, showsIndicators: false) {
|
||||||
@@ -64,15 +63,19 @@ struct ShellTabView: View {
|
|||||||
HStack {
|
HStack {
|
||||||
Spacer()
|
Spacer()
|
||||||
VStack {
|
VStack {
|
||||||
|
if !selected {
|
||||||
Text(container.sessions[id]!.handler.title)
|
Text(container.sessions[id]!.handler.title)
|
||||||
.monospaced()
|
.monospaced()
|
||||||
.foregroundStyle(foreground)
|
.foregroundStyle(foreground)
|
||||||
.bold(selected)
|
.opacity(0.7)
|
||||||
Text(container.sessions[id]!.handler.host.description)
|
|
||||||
.foregroundStyle(foreground.opacity(0.7))
|
|
||||||
.monospaced()
|
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
}
|
}
|
||||||
|
Text(container.sessions[id]!.handler.host.description)
|
||||||
|
.foregroundStyle(foreground)
|
||||||
|
.opacity(selected ? 1 : 0.7)
|
||||||
|
.monospaced()
|
||||||
|
.bold(selected)
|
||||||
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user