Skip to content

Commit abcaaec

Browse files
committed
Add terminal font preference key
1 parent b8433c1 commit abcaaec

4 files changed

Lines changed: 49 additions & 3 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import Preferences
2+
import SharedUIComponents
3+
import SwiftUI
4+
5+
#if canImport(ProHostApp)
6+
import ProHostApp
7+
#endif
8+
9+
struct TerminalSettingsView: View {
10+
class Settings: ObservableObject {
11+
@AppStorage(\.terminalFont) var terminalFont
12+
init() {}
13+
}
14+
15+
@StateObject var settings = Settings()
16+
17+
var body: some View {
18+
ScrollView {
19+
Form {
20+
FontPicker(font: $settings.terminalFont) {
21+
Text("Font of code")
22+
}
23+
}
24+
}
25+
26+
}
27+
}

Core/Sources/HostApp/FeatureSettingsView.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ struct FeatureSettingsView: View {
3434
subtitle: "Write code with natural language",
3535
image: "paintbrush"
3636
)
37+
38+
// #if canImport(ProHostApp)
39+
// ScrollView {
40+
// TerminalSettingsView().padding()
41+
// }
42+
// .sidebarItem(
43+
// tag: 3,
44+
// title: "Terminal",
45+
// subtitle: "Terminal chat tab",
46+
// image: "terminal"
47+
// )
48+
// #endif
3749
}
3850
}
3951
}

Pro

Submodule Pro updated from 5207bbf to c44d3a0

Tool/Sources/Preferences/Keys.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,14 +504,21 @@ public extension UserDefaultPreferenceKeys {
504504
var promptToCodeCodeFont: PreferenceKey<UserDefaultsStorageBox<StorableFont>> {
505505
.init(
506506
defaultValue: .init(.init(nsFont: .monospacedSystemFont(ofSize: 12, weight: .regular))),
507-
key: "promptToCodeCodeFont"
507+
key: "PromptToCodeCodeFont"
508508
)
509509
}
510510

511511
var chatCodeFont: PreferenceKey<UserDefaultsStorageBox<StorableFont>> {
512512
.init(
513513
defaultValue: .init(.init(nsFont: .monospacedSystemFont(ofSize: 12, weight: .regular))),
514-
key: "chatCodeFont"
514+
key: "ChatCodeFont"
515+
)
516+
}
517+
518+
var terminalFont: PreferenceKey<UserDefaultsStorageBox<StorableFont>> {
519+
.init(
520+
defaultValue: .init(.init(nsFont: .monospacedSystemFont(ofSize: 12, weight: .regular))),
521+
key: "TerminalCodeFont"
515522
)
516523
}
517524
}

0 commit comments

Comments
 (0)