Skip to content

Commit

Permalink
Make it possible to exit stash using the escape key.
Browse files Browse the repository at this point in the history
  • Loading branch information
beelsebob committed Nov 17, 2012
1 parent a67a831 commit 2fc6015
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Stash/STAAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#import "STAPreferencesController.h"

@interface STAAppDelegate : NSObject <NSApplicationDelegate, NSTableViewDataSource, NSTableViewDelegate, STAPreferencesDelegate>
@interface STAAppDelegate : NSResponder <NSApplicationDelegate, NSTableViewDataSource, NSTableViewDelegate, STAPreferencesDelegate>

@property (assign) IBOutlet NSWindow *window;
@property (strong) IBOutlet NSMenu *statusMenu;
Expand Down
7 changes: 7 additions & 0 deletions Stash/STAAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
[self toggleStashWindow:self];
}

}
};

Expand Down Expand Up @@ -169,11 +170,17 @@ - (IBAction)toggleStashWindow:(id)sender
else
{
[[self window] makeKeyAndOrderFront:self];
[[self window] setNextResponder:self];
[[self searchField] selectText:self];
[NSApp activateIgnoringOtherApps:YES];
}
}

- (void)cancelOperation:(id)sender
{
[self toggleStashWindow:sender];
}

- (void)windowDidResignKey:(NSNotification *)notification
{
[[self window] close];
Expand Down

0 comments on commit 2fc6015

Please sign in to comment.