remove hosts section if no hosts, delete invert.metal

This commit is contained in:
neon443
2025-07-16 18:36:04 +01:00
parent 6c32fda78d
commit 3dc37cf75e
3 changed files with 32 additions and 47 deletions

View File

@@ -64,7 +64,6 @@
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 */; }; A9835C3C2E17CCA500969508 /* TrafficLights.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9835C3B2E17CCA500969508 /* TrafficLights.swift */; };
A9835C3E2E17E9C100969508 /* invert.metal in Sources */ = {isa = PBXBuildFile; fileRef = A9835C3D2E17E9C100969508 /* invert.metal */; };
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 */; };
@@ -189,7 +188,6 @@
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>"; }; A9835C3B2E17CCA500969508 /* TrafficLights.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrafficLights.swift; sourceTree = "<group>"; };
A9835C3D2E17E9C100969508 /* invert.metal */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.metal; path = invert.metal; 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>"; };
@@ -467,7 +465,6 @@
A96C90A02E12B87900724253 /* TextBox.swift */, A96C90A02E12B87900724253 /* TextBox.swift */,
A9DA97722E0D40C100142DDC /* HostSymbolPreview.swift */, A9DA97722E0D40C100142DDC /* HostSymbolPreview.swift */,
A9835C3B2E17CCA500969508 /* TrafficLights.swift */, A9835C3B2E17CCA500969508 /* TrafficLights.swift */,
A9835C3D2E17E9C100969508 /* invert.metal */,
); );
path = Misc; path = Misc;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -758,7 +755,6 @@
A985545D2E055D4D009051BD /* ConnectionView.swift in Sources */, A985545D2E055D4D009051BD /* ConnectionView.swift in Sources */,
A9FD37592E143D74005319A8 /* GenericPasswordConvertible.swift in Sources */, A9FD37592E143D74005319A8 /* GenericPasswordConvertible.swift in Sources */,
A9485C762E1AF59F00209824 /* FontManagerView.swift in Sources */, A9485C762E1AF59F00209824 /* FontManagerView.swift in Sources */,
A9835C3E2E17E9C100969508 /* invert.metal in Sources */,
A98554592E0553AA009051BD /* KeyManager.swift in Sources */, A98554592E0553AA009051BD /* KeyManager.swift in Sources */,
A9C897EF2DF1A9A400EF9A5F /* SSHHandler.swift in Sources */, A9C897EF2DF1A9A400EF9A5F /* SSHHandler.swift in Sources */,
A9D819312E102D8700442D38 /* HostkeysView.swift in Sources */, A9D819312E102D8700442D38 /* HostkeysView.swift in Sources */,

View File

@@ -17,42 +17,44 @@ struct HostsView: View {
Text("Add your first Host!") Text("Add your first Host!")
} }
Section("Hosts") { if !hostsManager.hosts.isEmpty {
ForEach(hostsManager.hosts) { host in Section("Hosts") {
NavigationLink() { ForEach(hostsManager.hosts) { host in
ConnectionView( NavigationLink() {
handler: SSHHandler(host: host, keyManager: keyManager), ConnectionView(
hostsManager: hostsManager, handler: SSHHandler(host: host, keyManager: keyManager),
keyManager: keyManager hostsManager: hostsManager,
) keyManager: keyManager
} label: { )
HostSymbolPreview(symbol: host.symbol, label: host.label)
.frame(width: 40, height: 40)
Text(host.description)
}
.id(host)
.animation(.default, value: host)
.swipeActions(edge: .trailing) {
Button(role: .destructive) {
hostsManager.removeHost(host)
} label: { } label: {
Label("Delete", systemImage: "trash") HostSymbolPreview(symbol: host.symbol, label: host.label)
.frame(width: 40, height: 40)
Text(host.description)
} }
.tint(.red) .id(host)
Button() { .animation(.default, value: host)
hostsManager.duplicateHost(host) .swipeActions(edge: .trailing) {
} label: { Button(role: .destructive) {
Label("Duplicate", systemImage: "square.filled.on.square") hostsManager.removeHost(host)
} label: {
Label("Delete", systemImage: "trash")
}
.tint(.red)
Button() {
hostsManager.duplicateHost(host)
} label: {
Label("Duplicate", systemImage: "square.filled.on.square")
}
.tint(.blue)
} }
.tint(.blue)
} }
.onMove(perform: {
hostsManager.moveHost(from: $0, to: $1)
})
} }
.onMove(perform: { .transition(.opacity)
hostsManager.moveHost(from: $0, to: $1) .navigationTitle("ShhShell")
})
} }
.transition(.opacity)
.navigationTitle("ShhShell")
} }
} }

View File

@@ -1,13 +0,0 @@
//
// invert.metal
// ShhShell
//
// Created by neon443 on 04/07/2025.
//
#include <metal_stdlib>
using namespace metal;
[[ stitchable ]] half4 invert(float2 pos, half4 color) {
return half4(0, 1 - color.g, 1 - color.b, 1 - color.a);
}