I've been trying to replicate an app layout similar to Xcode where we have a tab bar in the canvas for different files that are open, while also having an inspector view. I have come across this problem where the tab bar from the WindowGroup goes into the inspector on the right.
This happens because the inspector is apparently owned by the Window. Interestingly, this doesn't happen for the sidebar. I don't see why it's not possible for it to not cut into inspector space either.
Here's my code for ContentView where the inspector is declared:
var body: some View {
NavigationSplitView(columnVisibility: $columnVisibility) {
FitsSidebarView(currentFitID: fit.id)
.navigationSplitViewColumnWidth(min: 180, ideal: 240, max: 360)
} detail: {
FittingCanvasView(fit: fit, session: session)
}
.inspector(isPresented: $isInspectorPresented) {
InspectorView()
.inspectorColumnWidth(min: 240, ideal: 280, max: 400)
}
And here's the code for my App Entry:
struct KiwiFittingApp: App {
var body: some Scene {
WindowGroup(
"Fit",
id: "fit-window",
for: FitRecord.ID.self
) { fitID in
FitWindowScene(fitID: fitID.wrappedValue)
} defaultValue: {
FitCatalog.defaultFit.id
}
.defaultSize(width: 1280, height: 800)
.commands {
SidebarCommands()
InspectorCommands()
}
}
}
Does anyone have any clue how to make it work with native components?