mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 23:52:21 +00:00
Merge pull request #208 from jamesrhurst/icon-chooser-fix
Fixed bug with icon resetting to default after closing popover
This commit is contained in:
@@ -26,7 +26,7 @@ NSInteger const kMPDefaultIcon = -1;
|
|||||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||||
if (self) {
|
if (self) {
|
||||||
_didCancel = NO;
|
_didCancel = YES;
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -40,6 +40,7 @@ NSInteger const kMPDefaultIcon = -1;
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)useDefault:(id)sender {
|
- (IBAction)useDefault:(id)sender {
|
||||||
|
self.didCancel = NO;
|
||||||
self.selectedIcon = kMPDefaultIcon;
|
self.selectedIcon = kMPDefaultIcon;
|
||||||
[self.popover performClose:self];
|
[self.popover performClose:self];
|
||||||
}
|
}
|
||||||
@@ -50,11 +51,12 @@ NSInteger const kMPDefaultIcon = -1;
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)reset {
|
- (void)reset {
|
||||||
self.didCancel = NO;
|
self.didCancel = YES;
|
||||||
self.selectedIcon = kMPDefaultIcon;
|
self.selectedIcon = kMPDefaultIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)_selectImage:(id)sender {
|
- (IBAction)_selectImage:(id)sender {
|
||||||
|
self.didCancel = NO;
|
||||||
NSButton *button = sender;
|
NSButton *button = sender;
|
||||||
NSImage *image = [button image];
|
NSImage *image = [button image];
|
||||||
NSUInteger buttonIndex = [[self.iconCollectionView content] indexOfObject:image];
|
NSUInteger buttonIndex = [[self.iconCollectionView content] indexOfObject:image];
|
||||||
|
|||||||
Reference in New Issue
Block a user