mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-23 23:29:28 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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, @"");
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user