diff options
| -rw-r--r-- | MASShortcutView.m | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/MASShortcutView.m b/MASShortcutView.m index f4eb8ff..b2d2531 100644 --- a/MASShortcutView.m +++ b/MASShortcutView.m @@ -42,15 +42,29 @@ { self = [super initWithFrame:frameRect]; if (self) { - _shortcutCell = [[[self.class shortcutCellClass] alloc] init]; - _shortcutCell.buttonType = NSPushOnPushOffButton; - _shortcutCell.font = [[NSFontManager sharedFontManager] convertFont:_shortcutCell.font toSize:BUTTON_FONT_SIZE]; - _enabled = YES; - [self resetShortcutCellStyle]; + [self commonInit]; + } + return self; +} + +- (id)initWithCoder:(NSCoder *)coder +{ + self = [super initWithCoder:coder]; + if (self) { + [self commonInit]; } return self; } +- (void)commonInit +{ + _shortcutCell = [[[self.class shortcutCellClass] alloc] init]; + _shortcutCell.buttonType = NSPushOnPushOffButton; + _shortcutCell.font = [[NSFontManager sharedFontManager] convertFont:_shortcutCell.font toSize:BUTTON_FONT_SIZE]; + _enabled = YES; + [self resetShortcutCellStyle]; +} + - (void)dealloc { [self activateEventMonitoring:NO]; |
