From c7a2970c7f17a1b19a76d9cb6addda8fb877a63a Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Wed, 22 May 2024 11:40:53 -0700 Subject: 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. --- Hotline/macOS/NewsEditorView.swift | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'Hotline/macOS/NewsEditorView.swift') 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() -- cgit