Removed custom toolbar sizing code since we seem not to need it anymore

This commit is contained in:
Michael Starke
2020-07-08 15:38:02 +02:00
parent 1404f9e336
commit c5694293a5
2 changed files with 1 additions and 21 deletions

View File

@@ -115,6 +115,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
self.toolbar = [[NSToolbar alloc] initWithIdentifier:@"MainWindowToolbar"];
self.toolbar.autosavesConfiguration = YES;
self.toolbar.allowsUserCustomization = YES;
/* center search in toolbar */
if (@available(macOS 10.14, *)) {
self.toolbar.centeredItemIdentifier = MPToolbarItemIdentifierSearch;
} else {

View File

@@ -37,25 +37,4 @@
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