Improve JSON editor for macOS

This commit is contained in:
世界
2025-11-26 22:25:52 +08:00
parent 3f1c716a0a
commit c5fd6a6b4e
25 changed files with 979 additions and 322 deletions
+11
View File
@@ -7,6 +7,10 @@ public struct MacApplication: Scene {
@State private var isMenuPresented = false
@StateObject private var environments = ExtensionEnvironments()
private let profileEditor: (Binding<String>, Bool) -> AnyView = { text, isEditable in
AnyView(CodeEditTextView(text: text, isEditable: isEditable))
}
public init() {}
public var body: some Scene {
Window("sing-box", id: "main", content: {
@@ -52,6 +56,13 @@ public struct MacApplication: Scene {
}
.menuBarExtraStyle(.window)
.menuBarExtraAccess(isPresented: $isMenuPresented)
WindowGroup(for: EditProfileContentView.Context.self) { $context in
EditProfileContentWindow(context: context)
.environment(\.profileEditor, profileEditor)
}
.windowResizability(.contentMinSize)
.defaultSize(width: 700, height: 500)
}
private func initialize() async {