aboutsummaryrefslogtreecommitdiff
path: root/Hotline/macOS/NewsEditorView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Hotline/macOS/NewsEditorView.swift')
-rw-r--r--Hotline/macOS/NewsEditorView.swift18
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()