remove dead ContentView.swift and IcedViewportRepresentable, relocate Notification.Name extensions
This commit is contained in:
parent
7a2aa08d1c
commit
4efab49959
|
|
@ -3,6 +3,16 @@ import Combine
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import UniformTypeIdentifiers
|
import UniformTypeIdentifiers
|
||||||
|
|
||||||
|
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")
|
||||||
|
}
|
||||||
|
|
||||||
class WindowController {
|
class WindowController {
|
||||||
let window: NSWindow
|
let window: NSWindow
|
||||||
let appState: AppState
|
let appState: AppState
|
||||||
|
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
import SwiftUI
|
|
||||||
|
|
||||||
struct ContentView: View {
|
|
||||||
@ObservedObject var state: AppState
|
|
||||||
@State private var themeVersion: Int = 0
|
|
||||||
|
|
||||||
var body: some View {
|
|
||||||
let _ = themeVersion
|
|
||||||
IcedViewportRepresentable()
|
|
||||||
.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")
|
|
||||||
}
|
|
||||||
|
|
@ -171,13 +171,3 @@ class IcedViewportView: NSView {
|
||||||
viewport_key_event(h, UInt32(event.keyCode), UInt32(event.modifierFlags.rawValue), true, nil)
|
viewport_key_event(h, UInt32(event.keyCode), UInt32(event.modifierFlags.rawValue), true, nil)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - SwiftUI Bridge
|
|
||||||
|
|
||||||
struct IcedViewportRepresentable: NSViewRepresentable {
|
|
||||||
func makeNSView(context: Context) -> IcedViewportView {
|
|
||||||
IcedViewportView(frame: .zero)
|
|
||||||
}
|
|
||||||
|
|
||||||
func updateNSView(_ nsView: IcedViewportView, context: Context) {}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue