Adopted new KeePassKit API, modernized Object-C syntax, optimized MPIconHelper

Signed-off-by: michael starke <michael.starke@hicknhack-software.com>
This commit is contained in:
michael starke
2015-08-05 15:34:03 +02:00
parent f1db1d4df5
commit a1a3017ef4
4 changed files with 19 additions and 22 deletions

View File

@@ -41,10 +41,10 @@ NSInteger const kMPDefaultIcon = -1;
- (void)didLoadView {
//[[self.imageButton cell] setBackgroundStyle:NSBackgroundStyleLowered];
[self.iconCollectionView setBackgroundColors:@[[NSColor clearColor]]];
[self.iconCollectionView setSelectable:YES];
[self.iconCollectionView setAllowsMultipleSelection:NO];
[self.iconCollectionView setContent:[MPIconHelper databaseIcons]];
self.iconCollectionView.backgroundColors = @[[NSColor clearColor]];
self.iconCollectionView.selectable = YES;
self.iconCollectionView.allowsMultipleSelection = NO;
self.iconCollectionView.content = [MPIconHelper databaseIcons];
}
- (IBAction)useDefault:(id)sender {
@@ -66,9 +66,9 @@ NSInteger const kMPDefaultIcon = -1;
- (IBAction)_selectImage:(id)sender {
self.didCancel = NO;
NSButton *button = sender;
NSImage *image = [button image];
NSUInteger buttonIndex = [[self.iconCollectionView content] indexOfObject:image];
self.selectedIcon = [[MPIconHelper databaseIconTypes] [buttonIndex] integerValue];
NSImage *image = button.image;
NSUInteger buttonIndex = [self.iconCollectionView.content indexOfObject:image];
self.selectedIcon = ((NSNumber *)[MPIconHelper databaseIconTypes][buttonIndex]).integerValue;
[self.popover performClose:self];
}