diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-01-29 19:05:51 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-01-29 19:05:51 +0000 |
commit | 00401575e1f0f16f13d56402ec45368982692b6c (patch) | |
tree | 678a6f8011b0b8c65c61b3ea654adb92fab9ab8f /Source/SPWindowAdditions.m | |
parent | c316e723764eba6141456acb8a61a4cdfcf68e62 (diff) | |
download | sequelpro-00401575e1f0f16f13d56402ec45368982692b6c.tar.gz sequelpro-00401575e1f0f16f13d56402ec45368982692b6c.tar.bz2 sequelpro-00401575e1f0f16f13d56402ec45368982692b6c.zip |
• bound three finger multi-touch right/left swipe event to go back/forward in table history
Diffstat (limited to 'Source/SPWindowAdditions.m')
-rw-r--r-- | Source/SPWindowAdditions.m | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/SPWindowAdditions.m b/Source/SPWindowAdditions.m index b04562e3..f74d92c4 100644 --- a/Source/SPWindowAdditions.m +++ b/Source/SPWindowAdditions.m @@ -24,6 +24,7 @@ // More info at <http://code.google.com/p/sequel-pro/> #import "SPWindowAdditions.h" +#import "TableDocument.h" @implementation NSWindow (SPWindowAdditions) @@ -75,4 +76,18 @@ [self setFrame:frame display:YES animate:YES]; } +// ------------------------------------------------------------------------------- +// Three finger multi-touch right/left swipe event to go back/forward in table history. +// ------------------------------------------------------------------------------- +- (void)swipeWithEvent:(NSEvent *)anEvent +{ + if([[self delegate] isKindOfClass:[TableDocument class]] + && [[self delegate] valueForKeyPath:@"spHistoryControllerInstance"] + && ![[self delegate] isWorking]) + if([anEvent deltaX] == -1.0f) + [[[self delegate] valueForKeyPath:@"spHistoryControllerInstance"] valueForKey:@"goForwardInHistory"]; + else if([anEvent deltaX] == 1.0f) + [[[self delegate] valueForKeyPath:@"spHistoryControllerInstance"] valueForKey:@"goBackInHistory"]; +} + @end |