Implement proper fullscreen enter and exit animations.
parent
0ddddb7965
commit
faf5eb586a
|
@ -472,16 +472,23 @@
|
||||||
NSRect contentRect = [contentView frame];
|
NSRect contentRect = [contentView frame];
|
||||||
const NSSize windowSize = [contentView convertSize:[mainWindow frame].size fromView: nil];
|
const NSSize windowSize = [contentView convertSize:[mainWindow frame].size fromView: nil];
|
||||||
|
|
||||||
|
[contentView addSubview: [nowPlaying view]];
|
||||||
|
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
|
||||||
|
[context setDuration:0.25];
|
||||||
NSRect nowPlayingFrame = [[nowPlaying view] frame];
|
NSRect nowPlayingFrame = [[nowPlaying view] frame];
|
||||||
nowPlayingFrame.size.width = windowSize.width;
|
nowPlayingFrame.size.width = windowSize.width;
|
||||||
[[nowPlaying view] setFrame: nowPlayingFrame];
|
[[nowPlaying view] setFrame: nowPlayingFrame];
|
||||||
|
|
||||||
[contentView addSubview: [nowPlaying view]];
|
|
||||||
[[nowPlaying view] setFrameOrigin: NSMakePoint(0.0, NSMaxY(contentRect) - nowPlayingFrame.size.height)];
|
[[nowPlaying view] setFrameOrigin: NSMakePoint(0.0, NSMaxY(contentRect) - nowPlayingFrame.size.height)];
|
||||||
|
|
||||||
NSRect mainViewFrame = [mainView frame];
|
NSRect mainViewFrame = [mainView frame];
|
||||||
mainViewFrame.size.height -= nowPlayingFrame.size.height;
|
mainViewFrame.size.height -= nowPlayingFrame.size.height;
|
||||||
[mainView setFrame:mainViewFrame];
|
[[mainView animator] setFrame:mainViewFrame];
|
||||||
|
|
||||||
|
} completionHandler:^{
|
||||||
|
|
||||||
|
}];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[[nowPlaying text] bind:@"value" toObject:currentEntryController withKeyPath:@"content.display" options:nil];
|
[[nowPlaying text] bind:@"value" toObject:currentEntryController withKeyPath:@"content.display" options:nil];
|
||||||
}
|
}
|
||||||
|
@ -495,11 +502,17 @@
|
||||||
NSRect nowPlayingFrame = [[nowPlaying view] frame];
|
NSRect nowPlayingFrame = [[nowPlaying view] frame];
|
||||||
NSRect mainViewFrame = [mainView frame];
|
NSRect mainViewFrame = [mainView frame];
|
||||||
mainViewFrame.size.height += nowPlayingFrame.size.height;
|
mainViewFrame.size.height += nowPlayingFrame.size.height;
|
||||||
[mainView setFrame:mainViewFrame];
|
//[mainView setFrame:mainViewFrame];
|
||||||
// [mainView setFrameOrigin:NSMakePoint(0.0, 0.0)];
|
// [mainView setFrameOrigin:NSMakePoint(0.0, 0.0)];
|
||||||
|
|
||||||
|
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
|
||||||
|
[context setDuration:0.25];
|
||||||
|
[[mainView animator] setFrame:mainViewFrame];
|
||||||
|
|
||||||
|
} completionHandler:^{
|
||||||
[[nowPlaying view] removeFromSuperview];
|
[[nowPlaying view] removeFromSuperview];
|
||||||
nowPlaying = nil;
|
nowPlaying = nil;
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue