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.
This commit is contained in:
James Hurst
2014-08-04 21:07:00 -04:00
parent 4180e00ab2
commit 04a14931c6

View File

@@ -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];