3

I have a NSDocument-based Mac app. Each window gets a default title with the document name and its edit state automatically.

My window is made up of a split view with a sidebar and the actual document contents. I use an NSVisualEffectView for the sidebar across the full height of the window.

Now the problem is that the window/document title is always at the center of the window, but with the sidebar, it looks out of place. It really should be centered in the white content section on the right (see image).

When making the sidebar wider, it even cuts into the window title.

Is there a way how I can control the placement of the default window title to make sure it stays centered relative to the white content view?

My window setup:

window?.titlebarAppearsTransparent = true
window?.styleMask.update(with: .fullSizeContentView)

Window example

Mark
  • 6,647
  • 1
  • 45
  • 88
  • Sadly, I think the only solution is to hide the OS title entirely and make your own. – Ky - May 03 '17 at 14:20
  • Note to self: take a look at [NSWindow standardWindowButton: NSWindowDocumentIconButton] and try to present a custom view. – Mark Jul 19 '17 at 10:49
  • Good luck and let us know how that goes! My guess is that it will either completely ignore your changes or that isn't the button you think it is – Ky - Jul 19 '17 at 21:00

0 Answers0