IconSelectionView now can be used to set default icons. Setting other Icons is broken for now. Setting custom icons doesn't work at all.

This commit is contained in:
michael starke
2013-12-01 02:29:37 +01:00
parent 36e493101a
commit 1a6d5114b9
10 changed files with 227 additions and 857 deletions

View File

@@ -8,6 +8,10 @@
#import "MPIconSelectViewController.h"
#import "MPIconHelper.h"
#import "MPDocument.h"
NSInteger const kMPDefaultIcon = -1;
@interface MPIconSelectViewController ()
@end
@@ -32,9 +36,22 @@
[self.iconCollectionView setSelectable:YES];
[self.iconCollectionView setAllowsMultipleSelection:NO];
[self.iconCollectionView setContent:[MPIconHelper databaseIcons]];
}
- (IBAction)useDefault:(id)sender {
self.selectedIcon = kMPDefaultIcon;
[self.popover performClose:self];
}
- (void)reset {
self.selectedIcon = kMPDefaultIcon;
}
- (IBAction)_selectImage:(id)sender {
NSButton *button = sender;
NSImage *image = [button image];
self.selectedIcon = [[self.iconCollectionView content] indexOfObject:image];
[self.popover performClose:self];
}
@end