Fixed crash on 10.8 and 10.9 caused by MPToolbarButton

Signed-off-by: michael starke <michael.starke@hicknhack-software.com>
This commit is contained in:
michael starke
2015-10-22 14:25:27 +02:00
parent 83a89b9d1a
commit 4c91a55410
7 changed files with 50 additions and 15 deletions

View File

@@ -89,6 +89,23 @@
}
- (void)setControlSize:(NSControlSize)controlSize {
NSImageRep *rep = [[self imageForSegment:0] bestRepresentationForRect:NSMakeRect(0, 0, 100, 100) context:nil hints:nil];
CGFloat scale = rep.size.width / rep.size.height;
switch (controlSize) {
case NSRegularControlSize:
[self imageForSegment:0].size = NSMakeSize(16 * scale, 16);
break;
case NSSmallControlSize:
[self imageForSegment:0].size = NSMakeSize(14 * scale, 14);
break;
case NSMiniControlSize:
[self imageForSegment:0].size = NSMakeSize(8 * scale, 8);
default:
break;
}
self.cell.controlSize = controlSize;
}

View File

@@ -7,6 +7,7 @@
//
#import "MPReferenceBuilderViewController.h"
#import "KPKReferenceKeys.h"
@interface MPReferenceBuilderViewController ()
@@ -40,7 +41,7 @@
if(allowCustomAttributes) {
[menu addItemWithTitle:NSLocalizedString(@"CUSTOM_ATTRIBUTE","") action:NULL keyEquivalent:@""];
}
NSArray *keys = @[ @"I", @"T", @"U", @"P", @"A", @"N", @"S" ];
NSArray *keys = @[ kKPKReferenceUUIDKey, kKPKReferenceTitleKey, kKPKReferenceUsernameKey, kKPKReferencePasswordKey, kKPKReferenceURLKey, kKPKReferenceNotesKey, @"S" ];
[menu.itemArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
NSMenuItem *item = (NSMenuItem *)obj;
NSAssert(keys.count > idx, @"");

View File

@@ -21,6 +21,7 @@
//
#import "MPToolbarButton.h"
#import "HNHCommon.h"
@implementation MPToolbarButton
@@ -54,7 +55,12 @@
default:
break;
}
super.controlSize = controlSize;
if([self.superclass instancesRespondToSelector:@selector(setControlSize:)]) {
super.controlSize = controlSize;
}
else {
self.cell.controlSize = controlSize;
}
}
- (NSControlSize)controlSize {

View File

@@ -62,9 +62,20 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2558</string>
<string>2560</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>www.nomadsland.de</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2012-2014 HicknHack Software GmbH. All rights reserved.</string>
<key>NSMainNibFile</key>
@@ -114,16 +125,5 @@
</dict>
</dict>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>www.nomadsland.de</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
</dict>
</plist>