diff --git a/Clocker/Onboarding/CLOnboardingWindowController.m b/Clocker/Onboarding/CLOnboardingWindowController.m index 778b5c4..88c2a39 100644 --- a/Clocker/Onboarding/CLOnboardingWindowController.m +++ b/Clocker/Onboarding/CLOnboardingWindowController.m @@ -10,10 +10,11 @@ #import #import + @interface CLOnboardingWindowController () + @property (weak) IBOutlet NSTextField *titleLabel; @property (weak) IBOutlet NSButton *continueButtonOutlet; - @property (strong, nonatomic) CLIntroViewController *introViewController; @end @@ -22,19 +23,14 @@ static CLOnboardingWindowController *sharedOnboardingWindow; @implementation CLOnboardingWindowController -- (void)windowDidLoad { +- (void)windowDidLoad +{ [super windowDidLoad]; self.window.backgroundColor = [NSColor whiteColor]; self.window.titleVisibility = NSWindowTitleHidden; - POPSpringAnimation *shake = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionX]; - shake.springBounciness = 35; - shake.velocity = @(1000); - - [self.titleLabel.layer pop_addAnimation:shake forKey:@"shakePassword"]; - // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. } @@ -49,16 +45,45 @@ static CLOnboardingWindowController *sharedOnboardingWindow; }); } + return sharedOnboardingWindow; } - (IBAction)continueButtonPressed:(id)sender { - self.introViewController = [[CLIntroViewController alloc] initWithNibName:@"CLIntroView" bundle:nil]; - [[self.window animator] setContentSize:self.introViewController.view.frame.size]; - [[self.window animator] setContentView:self.introViewController.view]; + self.introViewController = [[CLIntroViewController alloc] + initWithNibName:@"CLIntroView" bundle:nil]; + + CGRect oldFrame = self.window.frame; + CGRect newFrame = self.introViewController.view.frame; + + [self performBoundsAnimationWithOldRect:oldFrame andNewRect:newFrame]; + + +} + +- (void)performBoundsAnimationWithOldRect:(CGRect)fromRect andNewRect:(CGRect)newRect +{ + + + [self.window setFrame:fromRect display:NO animate:NO]; + + self.window.contentView.wantsLayer = YES; + + POPSpringAnimation *anim = [POPSpringAnimation animationWithPropertyNamed:kPOPViewBounds]; + + anim.toValue = [NSValue valueWithCGRect:newRect]; + + anim.springSpeed = 1; + + [self.window.contentView.layer pop_addAnimation:anim forKey:@"popBounds"]; + + [self.window setContentSize:self.introViewController.view.frame.size]; + + [self.window setContentView:self.introViewController.view]; } + @end diff --git a/Clocker/Onboarding/en.lproj/CLOnboardingWindow.xib b/Clocker/Onboarding/en.lproj/CLOnboardingWindow.xib index db66982..a468449 100644 --- a/Clocker/Onboarding/en.lproj/CLOnboardingWindow.xib +++ b/Clocker/Onboarding/en.lproj/CLOnboardingWindow.xib @@ -13,18 +13,18 @@ - + - + - - + + - + - + @@ -32,36 +32,36 @@ - + - + - + - - + + - - + + - - - - + + + @@ -92,7 +92,7 @@ DQ - + @@ -105,7 +105,7 @@ DQ - + diff --git a/Clocker/Preferences/CLPreferencesViewController.h b/Clocker/Preferences/CLPreferencesViewController.h index 708b71f..6469690 100644 --- a/Clocker/Preferences/CLPreferencesViewController.h +++ b/Clocker/Preferences/CLPreferencesViewController.h @@ -21,5 +21,6 @@ typedef enum : NSUInteger { - (void)refereshTimezoneTableView; +- (IBAction)addTimeZone:(id)sender; @end diff --git a/Clocker/Preferences/en.lproj/CLPreferencesView.xib b/Clocker/Preferences/en.lproj/CLPreferencesView.xib index ebfb653..118ce5c 100644 --- a/Clocker/Preferences/en.lproj/CLPreferencesView.xib +++ b/Clocker/Preferences/en.lproj/CLPreferencesView.xib @@ -220,28 +220,34 @@ CA