Skip to content

Commit

Permalink
Fix hold for seconds not appearing initially
Browse files Browse the repository at this point in the history
  • Loading branch information
zenangst committed Sep 26, 2023
1 parent a54fc8b commit b7a6eea
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 36 deletions.
5 changes: 1 addition & 4 deletions App/Entitlements/com.zenangst.Keyboard-Cowboy.entitlements
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.automation.apple-events</key>
<true/>
</dict>
<dict/>
</plist>
4 changes: 2 additions & 2 deletions App/Sources/UI/Views/KeyboardTriggerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ struct KeyboardTriggerView: View {
}
.padding([.leading, .trailing], 8)

WorkflowShortcutsView(focus, data: trigger.shortcuts, selectionManager: keyboardShortcutSelectionManager) { keyboardShortcuts in
onAction(.updateKeyboardShortcuts(workflowId: data.id,
WorkflowShortcutsView(focus, data: $trigger.shortcuts, selectionManager: keyboardShortcutSelectionManager) { keyboardShortcuts in
onAction(.updateKeyboardShortcuts(workflowId: data.id,
passthrough: passthrough,
holdDuration: Double(holdDurationText),
keyboardShortcuts: keyboardShortcuts))
Expand Down
6 changes: 3 additions & 3 deletions App/Sources/UI/Views/WorkflowShortcutsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import SwiftUI

struct WorkflowShortcutsView: View {
var focus: FocusState<AppFocus?>.Binding
@State private var data: [KeyShortcut]
@Binding private var data: [KeyShortcut]
private let onUpdate: ([KeyShortcut]) -> Void
private let selectionManager: SelectionManager<KeyShortcut>

init(_ focus: FocusState<AppFocus?>.Binding, data: [KeyShortcut],
init(_ focus: FocusState<AppFocus?>.Binding, data: Binding<[KeyShortcut]>,
selectionManager: SelectionManager<KeyShortcut>,
onUpdate: @escaping ([KeyShortcut]) -> Void) {
self.focus = focus
self.selectionManager = selectionManager
_data = .init(initialValue: data)
_data = data
self.onUpdate = onUpdate
}

Expand Down
69 changes: 44 additions & 25 deletions Fixtures/json/designTime.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,76 +4,95 @@
"name" : "Default configuration",
"groups" : [
{
"id" : "7DF42FEB-5702-4366-BCD7-2FA267CB3D1B",
"color" : "#EB5545",
"symbol" : "autostartstop",
"name" : "Automation",
"id" : "7DF42FEB-5702-4366-BCD7-2FA267CB3D1B",
"workflows" : [

],
"color" : "#EB5545"
{
"id" : "B6F3D78D-61AE-4759-83E4-7D137E2F2A1C",
"trigger" : {
"keyboardShortcuts" : {
"passthrough" : false,
"shortcuts" : [
{
"key" : "k",
"id" : "A9B35E85-0AFA-4B41-AA22-A66D3E242D29",
"lhs" : false,
"modifiers" : [
"@"
]
}
]
}
},
"name" : "Untitled workflow",
"execution" : "concurrent"
}
]
},
{
"id" : "7B6B3743-ED08-4558-990D-AF21309F8F7F",
"symbol" : "app.dashed",
"color" : "#F2A23C",
"name" : "Applications",
"workflows" : [

],
"color" : "#F2A23C"
"symbol" : "app.dashed"
},
{
"id" : "B43AE15C-6C64-4BD7-84E9-12C4C39EE623",
"symbol" : "applescript",
"name" : "AppleScripts",
"workflows" : [

],
"color" : "#F9D64A"
"symbol" : "applescript",
"id" : "B43AE15C-6C64-4BD7-84E9-12C4C39EE623",
"color" : "#F9D64A",
"name" : "AppleScripts"
},
{
"id" : "7F60EBF8-AB2A-4C23-AD46-E610DF7BAB0C",
"symbol" : "folder",
"color" : "#6BD35F",
"name" : "Files & Folders",
"workflows" : [

],
"color" : "#6BD35F"
"symbol" : "folder",
"id" : "7F60EBF8-AB2A-4C23-AD46-E610DF7BAB0C"
},
{
"id" : "D69E891C-21FD-456F-A121-9ED1E471B282",
"symbol" : "app.connected.to.app.below.fill",
"name" : "Rebinding",
"workflows" : [

],
"id" : "D69E891C-21FD-456F-A121-9ED1E471B282",
"name" : "Rebinding",
"symbol" : "app.connected.to.app.below.fill",
"color" : "#3984F7"
},
{
"id" : "F5FBD29B-694B-4110-9B10-ACAC4D10A60D",
"symbol" : "terminal",
"color" : "#B263EA",
"name" : "ShellScripts",
"symbol" : "terminal",
"workflows" : [

],
"color" : "#B263EA"
]
},
{
"id" : "749FB151-13A6-48D5-95DD-CA02D291A5D2",
"symbol" : "laptopcomputer",
"name" : "System",
"id" : "749FB151-13A6-48D5-95DD-CA02D291A5D2",
"color" : "#98989D",
"workflows" : [

],
"color" : "#98989D"
"symbol" : "laptopcomputer"
},
{
"id" : "9F862622-573B-4467-87A8-0ECF0692391E",
"symbol" : "safari",
"name" : "Websites",
"color" : "#A78F6D",
"workflows" : [

],
"color" : "#A78F6D"
"name" : "Websites",
"symbol" : "safari"
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ let project = Project(
"ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon",
"CODE_SIGN_IDENTITY": "Apple Development",
"CODE_SIGN_STYLE": "Automatic",
"CURRENT_PROJECT_VERSION": "230",
"CURRENT_PROJECT_VERSION": "235",
"DEVELOPMENT_TEAM": env["TEAM_ID"],
"ENABLE_HARDENED_RUNTIME": true,
"MARKETING_VERSION": "3.13.1",
"MARKETING_VERSION": "3.13.2",
"PRODUCT_NAME": "Keyboard Cowboy"
],
configurations: [
Expand Down

0 comments on commit b7a6eea

Please sign in to comment.