feat: set up window group for memo view

This commit is contained in:
dscyrescotti
2024-07-06 15:53:21 +07:00
parent cdee0d189d
commit 59b8f18a61
5 changed files with 81 additions and 1 deletions
+13
View File
@@ -30,5 +30,18 @@ struct MemolaApp: App {
.windowResizability(.contentSize)
.defaultSize(width: 1200, height: 800)
#endif
WindowGroup(id: "memo-view", for: URL.self) { url in
if let url = url.wrappedValue, let memo = Persistence.loadMemo(of: url) {
MemoView(memo: memo)
#if os(macOS)
.frame(minWidth: 1000, minHeight: 600)
#endif
}
}
#if os(macOS)
.defaultPosition(.center)
.windowResizability(.contentSize)
.defaultSize(width: 1200, height: 800)
#endif
}
}