From 04a14931c6035ff3f78cfb641f0d47d8d6ffb89b Mon Sep 17 00:00:00 2001 From: James Hurst Date: Mon, 4 Aug 2014 21:07:00 -0400 Subject: [PATCH] Fixed bug with icon resetting to default after closing popover When closing the icon chooser by clicking outside the popover, the icon would get reset to the default icon instead of keeping the current icon. --- MacPass/MPIconSelectViewController.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MacPass/MPIconSelectViewController.m b/MacPass/MPIconSelectViewController.m index 0a281705..f803885d 100644 --- a/MacPass/MPIconSelectViewController.m +++ b/MacPass/MPIconSelectViewController.m @@ -26,7 +26,7 @@ NSInteger const kMPDefaultIcon = -1; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { - _didCancel = NO; + _didCancel = YES; } return self; } @@ -40,6 +40,7 @@ NSInteger const kMPDefaultIcon = -1; } - (IBAction)useDefault:(id)sender { + self.didCancel = NO; self.selectedIcon = kMPDefaultIcon; [self.popover performClose:self]; } @@ -50,11 +51,12 @@ NSInteger const kMPDefaultIcon = -1; } - (void)reset { - self.didCancel = NO; + self.didCancel = YES; self.selectedIcon = kMPDefaultIcon; } - (IBAction)_selectImage:(id)sender { + self.didCancel = NO; NSButton *button = sender; NSImage *image = [button image]; NSUInteger buttonIndex = [[self.iconCollectionView content] indexOfObject:image];