aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-01-29 19:05:51 +0000
committerBibiko <bibiko@eva.mpg.de>2010-01-29 19:05:51 +0000
commit00401575e1f0f16f13d56402ec45368982692b6c (patch)
tree678a6f8011b0b8c65c61b3ea654adb92fab9ab8f /Source
parentc316e723764eba6141456acb8a61a4cdfcf68e62 (diff)
downloadsequelpro-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')
-rw-r--r--Source/SPWindowAdditions.m15
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