1

I am working on a text editor app that needs an inspector sidebar for special actions with the text. I am therefore using an NSSplitViewController to manage the overall layout. I want the sidebar to take advantage of macOS' new full-height sidebars. I already have an NSWindow with a fullSizeContentView style mask. And my corresponding NSSplitViewItem has the property allowsFullHeightLayout set to true.

Unfortunately, I am still getting this layout: Normal Height Inspector Sidebar

Additional information:

  • The Inspector sidebar is an NSHostingView with a SwiftUI View wrapped inside.
  • When using the accessibility inspector, I can see that the sidebar layout is expanded all the way up, but the NSToolbar seems to be ignoring it.
  • I need to keep both the title and toolbar
Arthur Guiot
  • 713
  • 10
  • 25
  • This blogpost helped me to figure out what to do: https://christiangiacomi.com/posts/setup-nstrackingseparatortoolbaritem-macos11/ – Arthur Guiot Jun 22 '22 at 06:09

1 Answers1

0

It is possible to let the toolbar know that there's a split view divider by using a special NSToolbarItem. By creating a custom identifier and rendering it as an NSTrackingSeparatorToolbarItem, I was able to extend the line all the way up.

To make the inspector view background extend to full height layout, I had to use window.titlebarAppearsTransparent = true.

This blogpost helped me to figure out everything: https://christiangiacomi.com/posts/setup-nstrackingseparatortoolbaritem-macos11/

Arthur Guiot
  • 713
  • 10
  • 25