mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
changed snippet picker opotions to use Buttons
using a sheet thats small by default
This commit is contained in:
@@ -22,18 +22,19 @@ struct SnippetPicker: View {
|
|||||||
.monospaced()
|
.monospaced()
|
||||||
}
|
}
|
||||||
ForEach(hostsManager.snippets) { snip in
|
ForEach(hostsManager.snippets) { snip in
|
||||||
Text(snip.name)
|
Button(snip.name) {
|
||||||
.onTapGesture {
|
dismiss()
|
||||||
dismiss()
|
callback?(snip)
|
||||||
callback?(snip)
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.toolbar {
|
.toolbar {
|
||||||
Button() {
|
ToolbarItem(placement: .topBarLeading) {
|
||||||
dismiss()
|
Button() {
|
||||||
} label: {
|
dismiss()
|
||||||
Image(systemName: "xmark")
|
} label: {
|
||||||
|
Image(systemName: "xmark")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listStyle(.grouped)
|
.listStyle(.grouped)
|
||||||
|
|||||||
@@ -87,6 +87,8 @@ struct ShellTabView: View {
|
|||||||
SnippetPicker(hostsManager: hostsManager) {
|
SnippetPicker(hostsManager: hostsManager) {
|
||||||
container.sessions[selectedID ?? UUID()]?.handler.writeToChannel($0.content)
|
container.sessions[selectedID ?? UUID()]?.handler.writeToChannel($0.content)
|
||||||
}
|
}
|
||||||
|
.presentationDragIndicator(.visible)
|
||||||
|
.presentationDetents([.fraction(0.4), .large])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 10)
|
.padding(.horizontal, 10)
|
||||||
|
|||||||
Reference in New Issue
Block a user