diff options
| author | Vadim Shpakovski | 2012-09-19 01:44:49 +0300 | 
|---|---|---|
| committer | Vadim Shpakovski | 2012-09-19 01:44:49 +0300 | 
| commit | da2e1af5741cff902ee4c06408316a92695450b8 (patch) | |
| tree | 220c30d666790cf3566c6e402cceb8af0dc2f2b1 /MASShortcutView.m | |
| parent | dddb527bfbe8de58fb2d6aeb780a25ff15a02ea4 (diff) | |
| download | MASShortcut-da2e1af5741cff902ee4c06408316a92695450b8.tar.bz2 | |
Adds a new appearance and fixes bugs related to key equivalents.
Diffstat (limited to 'MASShortcutView.m')
| -rw-r--r-- | MASShortcutView.m | 16 | 
1 files changed, 15 insertions, 1 deletions
| diff --git a/MASShortcutView.m b/MASShortcutView.m index a454ce1..27e6ae7 100644 --- a/MASShortcutView.m +++ b/MASShortcutView.m @@ -83,6 +83,10 @@              _shortcutCell.bezelStyle = NSTexturedRoundedBezelStyle;              break;          } +        case MASShortcutViewAppearanceRounded: { +            _shortcutCell.bezelStyle = NSRoundedBezelStyle; +            break; +        }      }  } @@ -148,6 +152,10 @@              [_shortcutCell drawWithFrame:CGRectOffset(frame, 0.0, 1.0) inView:self];              break;          } +        case MASShortcutViewAppearanceRounded: { +            [_shortcutCell drawWithFrame:CGRectOffset(frame, 0.0, 1.0) inView:self]; +            break; +        }      }  } @@ -195,7 +203,13 @@  - (void)getShortcutRect:(CGRect *)shortcutRectRef hintRect:(CGRect *)hintRectRef  {      CGRect shortcutRect, hintRect; -    CGRectDivide(self.bounds, &hintRect, &shortcutRect, HINT_BUTTON_WIDTH, CGRectMaxXEdge); +    CGFloat hintButtonWidth = HINT_BUTTON_WIDTH; +    switch (self.appearance) { +        case MASShortcutViewAppearanceTexturedRect: hintButtonWidth += 2.0; break; +        case MASShortcutViewAppearanceRounded: hintButtonWidth += 3.0; break; +        default: break; +    } +    CGRectDivide(self.bounds, &hintRect, &shortcutRect, hintButtonWidth, CGRectMaxXEdge);      if (shortcutRectRef)  *shortcutRectRef = shortcutRect;      if (hintRectRef) *hintRectRef = hintRect;  } | 
