diff options
| author | Dustin Mierau <dustin@mierau.me> | 2024-05-22 11:40:53 -0700 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2024-05-22 11:40:53 -0700 |
| commit | c7a2970c7f17a1b19a76d9cb6addda8fb877a63a (patch) | |
| tree | 20f52495dd9e599d7b3942ba8357c79bc394822d /Hotline/macOS/NewsEditorView.swift | |
| parent | 39255f49250e3b0ccbd42661614a7c8a3e0d4fb7 (diff) | |
Redesign of Message Board post sheet. Tweaks to NewsEditor. Disable smart quotes in message board and news editor text view. Hide news section on older servers.
Diffstat (limited to 'Hotline/macOS/NewsEditorView.swift')
| -rw-r--r-- | Hotline/macOS/NewsEditorView.swift | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/Hotline/macOS/NewsEditorView.swift b/Hotline/macOS/NewsEditorView.swift index ff33281..a6f72ec 100644 --- a/Hotline/macOS/NewsEditorView.swift +++ b/Hotline/macOS/NewsEditorView.swift @@ -110,17 +110,12 @@ struct NewsEditorView: View { Divider() - TextEditor(text: $text) - .textEditorStyle(.plain) - .font(.system(size: 14, design: .monospaced)) - .lineSpacing(3) - .padding(16) - .contentMargins(.top, -16.0, for: .scrollIndicators) - .contentMargins(.bottom, -16.0, for: .scrollIndicators) - .contentMargins(.trailing, -16.0, for: .scrollIndicators) - .scrollClipDisabled() + BetterTextEditor(text: $text) + .betterEditorFont(NSFont.monospacedSystemFont(ofSize: 14.0, weight: .regular)) + .betterEditorAutomaticSpellingCorrection(true) + .betterEditorTextInset(.init(width: 16, height: 18)) + .background(Color(nsColor: .textBackgroundColor)) .frame(maxWidth: .infinity, maxHeight: .infinity) - .clipped() .focused($focusedField, equals: .body) HStack(alignment: .center) { @@ -147,6 +142,9 @@ struct NewsEditorView: View { if !title.isEmpty { focusedField = .body } + else { + focusedField = .title + } } .onDisappear { dismiss() |