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 switcher: SwitcherModel?
|
||||||
var leftTab = LeftTab.lead
|
var leftTab = LeftTab.lead
|
||||||
var leadFocus = 0
|
var leadFocus = 0
|
||||||
|
var projectFocus = 0
|
||||||
@ObservationIgnored var pickerFrame: CGRect = .zero
|
@ObservationIgnored var pickerFrame: CGRect = .zero
|
||||||
@ObservationIgnored var menuHover = false
|
@ObservationIgnored var menuHover = false
|
||||||
var paneFrame: CGRect = .zero
|
var paneFrame: CGRect = .zero
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ struct ProjectView: View {
|
|||||||
}
|
}
|
||||||
refresh()
|
refresh()
|
||||||
}
|
}
|
||||||
|
.onChange(of: overlays.projectFocus) {
|
||||||
|
keys = true
|
||||||
|
}
|
||||||
.onDisappear {
|
.onDisappear {
|
||||||
off?()
|
off?()
|
||||||
off = nil
|
off = nil
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ func runGo(_ key: String, _ store: Store, _ overlays: Overlays) {
|
|||||||
createTask(project.id, .init(), store, overlays)
|
createTask(project.id, .init(), store, overlays)
|
||||||
}
|
}
|
||||||
case "p":
|
case "p":
|
||||||
|
overlays.window?.makeFirstResponder(nil)
|
||||||
|
overlays.projectFocus += 1
|
||||||
store.focusTab(.project)
|
store.focusTab(.project)
|
||||||
case "l":
|
case "l":
|
||||||
overlays.switcher?.close()
|
overlays.switcher?.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user