[Mac] Add some spacing between lines in the editor

This commit is contained in:
Matt Baer 2020-10-21 16:03:20 -04:00
parent 873d39eb5c
commit 5d59e180e7

View File

@ -1,6 +1,7 @@
import SwiftUI
struct PostEditorView: View {
private let bodyLineSpacing: CGFloat = 17 * 0.5
@EnvironmentObject var model: WriteFreelyModel
@ObservedObject var post: WFAPost
@ -35,6 +36,7 @@ struct PostEditorView: View {
}
TextEditor(text: $post.body)
.font(.custom("OpenSans-Regular", size: 17, relativeTo: Font.TextStyle.body))
.lineSpacing(bodyLineSpacing)
.opacity(post.body.count == 0 && !isHovering ? 0.0 : 1.0)
.onChange(of: post.body) { _ in
if post.status == PostStatus.published.rawValue && !updatingBodyFromServer {
@ -73,6 +75,7 @@ struct PostEditorView: View {
}
TextEditor(text: $post.body)
.font(.custom("Hack", size: 17, relativeTo: Font.TextStyle.body))
.lineSpacing(bodyLineSpacing)
.opacity(post.body.count == 0 && !isHovering ? 0.0 : 1.0)
.onChange(of: post.body) { _ in
if post.status == PostStatus.published.rawValue && !updatingBodyFromServer {
@ -111,6 +114,7 @@ struct PostEditorView: View {
}
TextEditor(text: $post.body)
.font(.custom("Lora", size: 17, relativeTo: Font.TextStyle.body))
.lineSpacing(bodyLineSpacing)
.opacity(post.body.count == 0 && !isHovering ? 0.0 : 1.0)
.onChange(of: post.body) { _ in
if post.status == PostStatus.published.rawValue && !updatingBodyFromServer {