37 lines
1.5 KiB
Swift
37 lines
1.5 KiB
Swift
import SwiftUI
|
||
|
||
struct HotkeySettingsView: View {
|
||
@ObservedObject private var settingsController = AppSettingsController.shared
|
||
|
||
var body: some View {
|
||
Form {
|
||
Section("Global") {
|
||
HotkeyRecorderView(label: "Toggle notch", binding: settingsController.binding(\.hotkeys.toggle))
|
||
}
|
||
|
||
Section("Terminal Tabs (active when notch is open)") {
|
||
HotkeyRecorderView(label: "New tab", binding: settingsController.binding(\.hotkeys.newTab))
|
||
HotkeyRecorderView(label: "Close tab", binding: settingsController.binding(\.hotkeys.closeTab))
|
||
HotkeyRecorderView(label: "Next tab", binding: settingsController.binding(\.hotkeys.nextTab))
|
||
HotkeyRecorderView(label: "Previous tab", binding: settingsController.binding(\.hotkeys.previousTab))
|
||
HotkeyRecorderView(label: "Detach tab", binding: settingsController.binding(\.hotkeys.detachTab))
|
||
}
|
||
|
||
Section {
|
||
Text("⌘1–9 always switch to tab by number. Size preset hotkeys are configured in Terminal > Size Presets.")
|
||
.font(.caption)
|
||
.foregroundStyle(.secondary)
|
||
}
|
||
|
||
Section {
|
||
Button("Reset to Defaults") {
|
||
settingsController.update {
|
||
$0.hotkeys = AppSettings.default.hotkeys
|
||
}
|
||
}
|
||
}
|
||
}
|
||
.formStyle(.grouped)
|
||
}
|
||
}
|