-
-
Save primalmotion/622618 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)showActiveView | |
{ | |
var centerX = [[[CPApp mainWindow] contentView] frame].size.width / 2, | |
centerY = [[[CPApp mainWindow] contentView] frame].size.height / 2, | |
frameTo = [activeView frame], | |
frameFrom; | |
frameTo.origin.x = centerX - (frameTo.size.width / 2); | |
frameTo.origin.y = centerY - (frameTo.size.height / 2); | |
frameFrom = CGRectMakeCopy(frameTo); | |
if (!isShowingView) | |
{ | |
frameFrom.size.width = (frameFrom.size.width / 1.1); | |
frameFrom.size.height = (frameFrom.size.height / 1.1); | |
} | |
else | |
{ | |
frameFrom.origin.x = frameFrom.origin.x + 20; | |
frameFrom.origin.y = frameFrom.origin.y + 20; | |
} | |
[activeView setBackgroundColor:[CPColor whiteColor]]; | |
[activeView setAlphaValue:0]; | |
//show the view | |
[activeView setFrame:frameFrom]; | |
[activeView makeCenterOfSuperview]; | |
if (!isShowingView) | |
{ | |
[[[CPApp mainWindow] contentView] addSubview:activeView]; | |
[[[CPApp mainWindow] contentView] addSubview:overlayView]; | |
} | |
else | |
[[[CPApp mainWindow] contentView] addSubview:activeView]; | |
if (!isShowingView) | |
[overlayView setAlphaValue:0.7 animate:YES duration:.4]; | |
[activeView setFrame:frameTo animate:YES duration:.15]; | |
[activeView setAlphaValue:1 animate:YES duration:.2]; | |
isShowingView = YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment