mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
redid icon picker ui
added applyscrollbacklenght with fallbacks added blueprint icon variant
This commit is contained in:
BIN
ShhShell Blueprint.pxd
Normal file
BIN
ShhShell Blueprint.pxd
Normal file
Binary file not shown.
@@ -56,15 +56,26 @@ struct SettingsView: View {
|
|||||||
Section("App Icon") {
|
Section("App Icon") {
|
||||||
HStack {
|
HStack {
|
||||||
ForEach(AppIcon.allCases, id: \.self) { icon in
|
ForEach(AppIcon.allCases, id: \.self) { icon in
|
||||||
|
let isSelected = hostsManager.settings.appIcon == icon
|
||||||
|
ZStack {
|
||||||
|
RoundedRectangle(cornerRadius: 21.5)
|
||||||
|
.foregroundStyle(.gray.opacity(0.5))
|
||||||
|
.opacity(isSelected ? 1 : 0)
|
||||||
VStack(alignment: .center) {
|
VStack(alignment: .center) {
|
||||||
icon.image
|
icon.image
|
||||||
.resizable().scaledToFit()
|
.resizable().scaledToFit()
|
||||||
.frame(maxWidth: 50)
|
.frame(maxWidth: 85)
|
||||||
.clipShape(RoundedRectangle(cornerRadius: 11))
|
.clipShape(RoundedRectangle(cornerRadius: 16.5))
|
||||||
|
.padding(5)
|
||||||
|
Spacer(minLength: 10)
|
||||||
Text("\(icon)").tag(icon)
|
Text("\(icon)").tag(icon)
|
||||||
|
.font(.caption)
|
||||||
|
.padding(5)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.frame(maxWidth: 85)
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
hostsManager.settings.appIcon = icon
|
withAnimation { hostsManager.settings.appIcon = icon }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,9 +79,20 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
|
|||||||
// TODO: selectedtext and cursor colors
|
// TODO: selectedtext and cursor colors
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func applyScrollbackLength() {
|
||||||
|
guard let scrollback = hostsManager?.settings.scrollback else {
|
||||||
|
print("hey!")
|
||||||
|
print("scrollback not found, setting to 1,000")
|
||||||
|
getTerminal().options.scrollback = 1_000
|
||||||
|
return
|
||||||
|
}
|
||||||
|
getTerminal().options.scrollback = Int(scrollback)
|
||||||
|
print("set scrollback to \(Int(scrollback))")
|
||||||
|
}
|
||||||
|
|
||||||
public override init(frame: CGRect) {
|
public override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
getTerminal().options.scrollback = 10_0000
|
applyScrollbackLength()
|
||||||
terminalDelegate = self
|
terminalDelegate = self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user