mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-17 19:29:24 +00:00
Removed custom toolbar sizing code since we seem not to need it anymore
This commit is contained in:
@@ -115,6 +115,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
|||||||
self.toolbar = [[NSToolbar alloc] initWithIdentifier:@"MainWindowToolbar"];
|
self.toolbar = [[NSToolbar alloc] initWithIdentifier:@"MainWindowToolbar"];
|
||||||
self.toolbar.autosavesConfiguration = YES;
|
self.toolbar.autosavesConfiguration = YES;
|
||||||
self.toolbar.allowsUserCustomization = YES;
|
self.toolbar.allowsUserCustomization = YES;
|
||||||
|
/* center search in toolbar */
|
||||||
if (@available(macOS 10.14, *)) {
|
if (@available(macOS 10.14, *)) {
|
||||||
self.toolbar.centeredItemIdentifier = MPToolbarItemIdentifierSearch;
|
self.toolbar.centeredItemIdentifier = MPToolbarItemIdentifierSearch;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -37,25 +37,4 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setControlSize:(NSControlSize)controlSize {
|
|
||||||
NSImageRep *rep = [self.image bestRepresentationForRect:NSMakeRect(0, 0, 100, 100) context:nil hints:nil];
|
|
||||||
CGFloat scale = rep.size.width / rep.size.height;
|
|
||||||
switch (controlSize) {
|
|
||||||
case NSControlSizeRegular:
|
|
||||||
self.image.size = NSMakeSize(16 * scale, 16);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NSControlSizeSmall:
|
|
||||||
self.image.size = NSMakeSize(14 * scale, 14);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NSControlSizeMini:
|
|
||||||
self.image.size = NSMakeSize(8 * scale, 8);
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
super.controlSize = controlSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Reference in New Issue
Block a user