mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
[Mac] Add some spacing between lines in the editor
This commit is contained in:
parent
873d39eb5c
commit
5d59e180e7
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user