From e2b2d5b9e15cd5c8341202e48f2d63c39963b591 Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Mon, 16 Feb 2015 10:22:22 -0500 Subject: Allow first responder support to be turned on and off --- Framework/MASShortcutView.h | 2 ++ Framework/MASShortcutView.m | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'Framework') diff --git a/Framework/MASShortcutView.h b/Framework/MASShortcutView.h index 166be44..656f4e4 100644 --- a/Framework/MASShortcutView.h +++ b/Framework/MASShortcutView.h @@ -21,4 +21,6 @@ typedef enum { /// Returns custom class for drawing control. + (Class)shortcutCellClass; +- (void)setAcceptsFirstResponder:(BOOL)value; + @end diff --git a/Framework/MASShortcutView.m b/Framework/MASShortcutView.m index 4132ce2..d96989c 100644 --- a/Framework/MASShortcutView.m +++ b/Framework/MASShortcutView.m @@ -24,6 +24,7 @@ NSString *const MASShortcutBinding = @"shortcutValue"; NSInteger _shortcutToolTipTag; NSInteger _hintToolTipTag; NSTrackingArea *_hintArea; + BOOL _acceptsFirstResponder; } #pragma mark - @@ -59,6 +60,7 @@ NSString *const MASShortcutBinding = @"shortcutValue"; _shortcutValidator = [MASShortcutValidator sharedValidator]; _enabled = YES; _showsDeleteButton = YES; + _acceptsFirstResponder = NO; [self resetShortcutCellStyle]; } @@ -565,7 +567,12 @@ void *kUserDataHint = &kUserDataHint; - (BOOL)acceptsFirstResponder { - return YES; + return _acceptsFirstResponder; +} + +- (void)setAcceptsFirstResponder:(BOOL)value +{ + _acceptsFirstResponder = value; } - (BOOL)becomeFirstResponder -- cgit v1.2.3