Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traffic light buttons reset their positions when NSDocument becomes edited. #91

Closed
beefon opened this issue Jan 15, 2013 · 5 comments
Closed

Comments

@beefon
Copy link

beefon commented Jan 15, 2013

In document app, if the NSDocument becomes edited and "– Edited" label appears in title bar, the position of the traffic light buttons reset to default.

You can check this issue by sending updateChangeCount:NSChangeDiscardable message.

When this happens, no notification is being sent. hasUnautosavedChanges/isDocumentEdited are not KVO observable.

I can't find the workaround to resolve this issue. The only chance to do this without going into Private API is to override updateChangeCount: method and update titlebar's layout from this.

The other option is to re-layout title bar from within drawRect: (since system redraws it), but this solution is ugly.

Any ideas?

@indragiek
Copy link
Owner

I think the cleanest solution is just to have a public method on INAppStoreWindow to update the title bar layout and to have the NSDocument subclass take care of calling that method at the appropriate times. We definitely can't use private APIs as that would get us rejected from the MAS, and triggering layout from -drawRect is pretty ugly as you said.

@calebd
Copy link

calebd commented Nov 19, 2013

Bump.

@soffes
Copy link

soffes commented Nov 19, 2013

+1

@jwilling
Copy link
Contributor

Pull requests are but a fork away, folks!

indragiek added a commit that referenced this issue Jan 6, 2014
@indragiek
Copy link
Owner

@beefon @calebd @soffes I didn't want to add the nasty fix for this issue to the main INAppStoreWindow code, so I added a category inside the Extensions folder that swizzles -updateChangeCount: to relayout the INAppStoreWindow titlebar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants