Separate code font size

This commit is contained in:
Ian Gulliver
2026-10-21 10:15:26 -07:00
parent 1ab0ebad9f
commit b5f23e20c2
4 changed files with 35 additions and 18 deletions
+19 -9
View File
@@ -28,10 +28,15 @@ struct SettingsView: View {
.fixedSize(horizontal: false, vertical: true)
ServerColorPicker()
heading("Font size")
Text("The size of body text, on every Mac you use. Other text grows and shrinks with it.")
Text("The size of body text and of code, on every Mac you use. Other text grows and shrinks with them.")
.foregroundStyle(Palette.muted)
.fixedSize(horizontal: false, vertical: true)
FontSizeStepper()
FontSizeStepper(label: "Text", size: FontSize.shared.body) { n in
FontSize.shared.set(body: n, code: FontSize.shared.code)
}
FontSizeStepper(label: "Code", size: FontSize.shared.code) { n in
FontSize.shared.set(body: FontSize.shared.body, code: n)
}
heading("Notifications")
DeviceNotifications()
PrefsBox()
@@ -98,21 +103,26 @@ private struct ServerColorPicker: View {
}
private struct FontSizeStepper: View {
let label: String
let size: Int
let set: (Int) -> Void
var body: some View {
let fonts = FontSize.shared
HStack(spacing: 8) {
Text(label)
.frame(width: 48, alignment: .leading)
Button("−") {
fonts.set(fonts.body - 1)
set(size - 1)
}
.buttonStyle(WebButtonStyle())
.disabled(fonts.body <= FontSize.range.lowerBound)
Text("\(fonts.body) pt")
.disabled(size <= FontSize.range.lowerBound)
Text("\(size) pt")
.monospacedDigit()
Button("+") {
fonts.set(fonts.body + 1)
set(size + 1)
}
.buttonStyle(WebButtonStyle())
.disabled(fonts.body >= FontSize.range.upperBound)
.disabled(size >= FontSize.range.upperBound)
}
.padding(.top, 8)
}
@@ -123,7 +133,7 @@ private struct SyncState: View {
TimelineView(.periodic(from: .now, by: 30)) { _ in
if let sync = Servers.shared.sync {
if sync.ok {
Text("This Mac shares its servers, window colors, font size, drafts and task visits through iCloud. Last synced \(ago(sync.at)).")
Text("This Mac shares its servers, window colors, font sizes, drafts and task visits through iCloud. Last synced \(ago(sync.at)).")
.fixedSize(horizontal: false, vertical: true)
} else {
Text("iCloud sync is failing on this Mac, so changes made here aren't reaching your other Macs. Failed \(ago(sync.at)): \(sync.error ?? "")")