Focus the Project tab's keyboard on Cmd-P
This commit is contained in:
@@ -53,6 +53,7 @@ final class Overlays {
|
||||
var switcher: SwitcherModel?
|
||||
var leftTab = LeftTab.lead
|
||||
var leadFocus = 0
|
||||
var projectFocus = 0
|
||||
@ObservationIgnored var pickerFrame: CGRect = .zero
|
||||
@ObservationIgnored var menuHover = false
|
||||
var paneFrame: CGRect = .zero
|
||||
|
||||
@@ -57,6 +57,9 @@ struct ProjectView: View {
|
||||
}
|
||||
refresh()
|
||||
}
|
||||
.onChange(of: overlays.projectFocus) {
|
||||
keys = true
|
||||
}
|
||||
.onDisappear {
|
||||
off?()
|
||||
off = nil
|
||||
|
||||
@@ -18,6 +18,8 @@ func runGo(_ key: String, _ store: Store, _ overlays: Overlays) {
|
||||
createTask(project.id, .init(), store, overlays)
|
||||
}
|
||||
case "p":
|
||||
overlays.window?.makeFirstResponder(nil)
|
||||
overlays.projectFocus += 1
|
||||
store.focusTab(.project)
|
||||
case "l":
|
||||
overlays.switcher?.close()
|
||||
|
||||
Reference in New Issue
Block a user