Fix add button. Fix hotkeys in settings. Add Workspace hotkeys
This commit is contained in:
@@ -75,6 +75,11 @@ struct WorkspacesSettingsView: View {
|
||||
renameSelectedWorkspace()
|
||||
}
|
||||
|
||||
OptionalHotkeyRecorderView(
|
||||
label: "Jump Hotkey",
|
||||
binding: workspaceHotkeyBinding(for: summary.id)
|
||||
)
|
||||
|
||||
HStack {
|
||||
Button("Save Name") {
|
||||
renameSelectedWorkspace()
|
||||
@@ -86,6 +91,10 @@ struct WorkspacesSettingsView: View {
|
||||
}
|
||||
.accessibilityIdentifier("settings.workspaces.new")
|
||||
}
|
||||
|
||||
Text("Workspace jump hotkeys are active when the notch is open and switch the current screen to this workspace.")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
|
||||
Section("Usage") {
|
||||
@@ -256,6 +265,17 @@ struct WorkspacesSettingsView: View {
|
||||
renameDraft = workspaceRegistry.summary(for: workspaceID)?.name ?? ""
|
||||
}
|
||||
|
||||
private func workspaceHotkeyBinding(for workspaceID: WorkspaceID) -> Binding<HotkeyBinding?> {
|
||||
Binding(
|
||||
get: {
|
||||
workspaceRegistry.summary(for: workspaceID)?.hotkey
|
||||
},
|
||||
set: { newValue in
|
||||
workspaceRegistry.updateWorkspaceHotkey(id: workspaceID, to: newValue)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private func deleteSelectedWorkspace() {
|
||||
guard let effectiveSelectedWorkspaceID,
|
||||
let fallbackWorkspaceID = screenRegistry.deleteWorkspace(
|
||||
|
||||
Reference in New Issue
Block a user