diff options
-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 |