> On 5 Mar 2017, at 10:35 pm, Kyle Sluder <k...@ksluder.com> wrote:
> 
> On Fri, Mar 3, 2017, at 08:39 AM, Mark Allan wrote:
>> Hi all,
>> 
>> I've got an NSWindow which has an NSToolbar added programmatically. The
>> window does not use a shared title/toolbar.  I now want to add a little
>> bit of text/button to the window's titlebar, so for OS X 10.6 to 10.9,
>> I'm doing it the old way playing around with NSWindow subviews, which
>> works fine.
>> 
>> On versions 10.10+ I'm using addTitlebarAccessoryViewController which
>> works great on 10.11 and 10.12, but for some reason it shifts the toolbar
>> buttons out of position on 10.10.
>> 
>> Judging by the AppKit release notes, this is a known issue which was
>> fixed in 10.11, and also by linking on 10.11
>> 
>>> For applications linked on 10.11 and higher, a 
>>> NSTitlebarAccessoryViewController with the layoutAttribute set to 
>>> NSLayoutAttributeRight will no longer right indent toolbar items, unless 
>>> the titleVisibility == NSWindowTitleHidden. This allows placing a 
>>> view/button/textfield (etc) above the toolbar without right indenting the 
>>> toolbar. However, for the NSWindowTitleHidden, there is still a desire to 
>>> indent the toolbar on the right to leave space for the accessory view.
>> 
>> I'm currently building on macOS 10.12 (with target of 10.6) but the issue
>> still shows up for users on OS X 10.11, even with the viewcontroller's
>> layoutAttribute = NSLayoutAttributeRight.
>> 
>> Does anyone know of a fix or workaround I could use please?
> 
> Is it possible to reproduce this in a sample app? This should be
> behaving as documented in the release notes.
> 
> --Kyle Sluder

Hi Kyle,

Yes, I've just moved all the relevant code in to a new sample app and it 
behaves the same way.  Below is a link to the code and a three screenshots 
showing how it appears on 10.6, 10.10 and 10.11.

https://www.dropbox.com/s/1adygl9r8mhfn0s/TestApp_TitlebarAccesoryTrouble.zip?dl=0
 
<https://www.dropbox.com/s/1adygl9r8mhfn0s/TestApp_TitlebarAccesoryTrouble.zip?dl=0>

Many thanks
Mark

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to