mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-23 06:49:32 +00:00
Added MPToolbarButton to handle small control size in Toolbar
EntryEditView now gets displayed (without any functionality)
This commit is contained in:
36
MacPass/MPToolbarButton.m
Normal file
36
MacPass/MPToolbarButton.m
Normal file
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// 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
|
||||
|
||||
- (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
|
||||
Reference in New Issue
Block a user