Skip to content

Commit da7b1f3

Browse files
committed
Add settings access in ContentView and ProfileListView for macOS 14.0 and earlier versions
1 parent ae59275 commit da7b1f3

4 files changed

Lines changed: 37 additions & 2 deletions

File tree

.claude/settings.local.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"allow": [
44
"Bash(mkdir:*)",
55
"Bash(swift build:*)",
6-
"Bash(mv:*)"
6+
"Bash(mv:*)",
7+
"Bash(swift run:*)"
78
],
89
"deny": [],
910
"ask": []

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,7 @@ DerivedData/
3131
.coverage/
3232

3333
# Debug
34-
*.dSYM/
34+
*.dSYM/
35+
36+
# Claude
37+
.claude/

Sources/iTermGUI/Views/ContentView.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,21 @@ struct EmptyStateView: View {
5353
Label("Import SSH Config", systemImage: "square.and.arrow.down")
5454
}
5555
.buttonStyle(.bordered)
56+
57+
if #available(macOS 14.0, *) {
58+
SettingsLink {
59+
Label("Settings", systemImage: "gearshape")
60+
.frame(minWidth: 80)
61+
}
62+
.buttonStyle(.bordered)
63+
} else {
64+
Button(action: {
65+
NSApp.sendAction(Selector(("showPreferencesWindow:")), to: nil, from: nil)
66+
}) {
67+
Label("Settings", systemImage: "gearshape")
68+
}
69+
.buttonStyle(.bordered)
70+
}
5671
}
5772
}
5873
.frame(maxWidth: .infinity, maxHeight: .infinity)

Sources/iTermGUI/Views/ProfileListView.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,22 @@ struct ProfileListView: View {
9292
Image(systemName: "plus")
9393
}
9494
}
95+
96+
ToolbarItem(placement: .automatic) {
97+
if #available(macOS 14.0, *) {
98+
SettingsLink {
99+
Image(systemName: "gearshape")
100+
}
101+
.help("Open Settings (⌘,)")
102+
} else {
103+
Button(action: {
104+
NSApp.sendAction(Selector(("showPreferencesWindow:")), to: nil, from: nil)
105+
}) {
106+
Image(systemName: "gearshape")
107+
}
108+
.help("Open Settings (⌘,)")
109+
}
110+
}
95111
}
96112
.onDeleteCommand {
97113
for profile in profileManager.selectedProfiles {

0 commit comments

Comments
 (0)