Re: How to calculate NSToolbar height in fullscreen mode
Re: How to calculate NSToolbar height in fullscreen mode
- Subject: Re: How to calculate NSToolbar height in fullscreen mode
- From: Nava Carmon <email@hidden>
- Date: Tue, 25 Sep 2012 14:07:30 +0200
It's good to know that I'm not alone in this ordeal :), though it doesn't solve the problem.
The height of toolbar (as it returned by the function, that I took from Apple's example) before entering the FS is some 50 pix.
Measured height of the same toolbar in FS is 63 pix (both are without title bar). So I cannot use the cached toolbar height. That's what I'm asking whether there is an API, that returns it?
Because if i set the frame of the window in FS mode to be as NSScreen's frame the detached toolbar will cover the upper part of the window (even before sliding down with the menu bar), which I want to prevent.
Best Regards,
Nava Carmon,
Moshiach Times Ltd.,
e-mail: email@hidden
Skype: navacarmon
Phone: +972.52.8157770
On Sep 24, 2012, at 9:07 PM, Lee Ann Rucker wrote:
>
> On Sep 24, 2012, at 5:50 AM, Nava Carmon wrote:
>
>> Hi,
>>
>> I have to perform custom animation for NSWindow transition to full screen mode. The window have a NSToolbar in icons-only mode with custom items.
>> How to calculate properly the final frame of such a window in full screen? Seems, that the height of the toolbar in the fullscreen is not the same as in regular mode (not including title).
>>
>> Thanks
>>
>> Best Regards,
>>
>> Nava Carmon,
>>
>
>
> rdar://12144703
>
> http://openradar.appspot.com/12144703
>
> In window:startCustomAnimationToExitFullScreenWithDuration:, I know the target contentRect but I can't use -frameRectForContentRect: to find the target frameRect because the window style is still fullscreen, and can't use +frameRectForContentRect:styleMask: because it doesn't know about the toolbar.
> Because all the windows using the same toolbar get updated when the toolbar style changes, I can't just save the window and/or toolbar size before going into fullscreen because it may not be valid when I exit.
>
> Though if you always keep the same toolbar style and size you should be able to cache the toolbar height from before you enter FS and restore it coming out; even if it is different in FS (something I've never seen) it's the standard window you care about. The FS window always covers the entire screen; the toolbar slides down over it and you don't need to worry about it. It's not even a child of your window at that point, it's got a special window it lives in.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden