mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 10:32:26 +00:00
45 lines
880 B
Objective-C
45 lines
880 B
Objective-C
//
|
|
// MPButton.m
|
|
// MacPass
|
|
//
|
|
// Created by michael starke on 26.02.13.
|
|
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
|
//
|
|
|
|
#import "MPToolbarButton.h"
|
|
|
|
@implementation MPToolbarButton
|
|
|
|
- (id)initWithFrame:(NSRect)frameRect {
|
|
self = [super initWithFrame:frameRect];
|
|
if(self) {
|
|
[self setFocusRingType:NSFocusRingTypeNone];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)setControlSize:(NSControlSize)controlSize {
|
|
[[self cell] setControlSize:controlSize];
|
|
switch (controlSize) {
|
|
case NSRegularControlSize:
|
|
[[self image] setSize:NSMakeSize(16, 16)];
|
|
break;
|
|
|
|
case NSSmallControlSize:
|
|
[[self image] setSize:NSMakeSize(14, 14)];
|
|
break;
|
|
|
|
case NSMiniControlSize:
|
|
[[self image] setSize:NSMakeSize(8, 8)];
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
- (NSControlSize)controlSize {
|
|
return [[self cell] controlSize];
|
|
}
|
|
|
|
@end
|