28 lines
988 B
Swift
28 lines
988 B
Swift
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
@ObservedObject var state: AppState
|
|
@State private var themeVersion: Int = 0
|
|
|
|
var body: some View {
|
|
let _ = themeVersion
|
|
EditorView(state: state)
|
|
.frame(minWidth: 400)
|
|
.frame(minWidth: 700, minHeight: 400)
|
|
.background(Color(ns: Theme.current.base))
|
|
.onReceive(NotificationCenter.default.publisher(for: .settingsChanged)) { _ in
|
|
themeVersion += 1
|
|
}
|
|
}
|
|
}
|
|
|
|
extension Notification.Name {
|
|
static let focusEditor = Notification.Name("focusEditor")
|
|
static let focusTitle = Notification.Name("focusTitle")
|
|
static let formatDocument = Notification.Name("formatDocument")
|
|
static let insertTable = Notification.Name("insertTable")
|
|
static let boldSelection = Notification.Name("boldSelection")
|
|
static let italicizeSelection = Notification.Name("italicizeSelection")
|
|
static let smartEval = Notification.Name("smartEval")
|
|
}
|