diff options
author | stuconnolly <stuart02@gmail.com> | 2011-05-09 20:08:53 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2011-05-09 20:08:53 +0000 |
commit | 5914260a1ca2db3da190fde077145756ba169bf4 (patch) | |
tree | 88e05c7abf6e3832da2e1ae6b57068700610fd3a /Frameworks/PSMTabBar/PSMTabBarControl.m | |
parent | 4efbaf34545f7a11baf3b426b8a9b1c25f4f93c7 (diff) | |
download | sequelpro-5914260a1ca2db3da190fde077145756ba169bf4.tar.gz sequelpro-5914260a1ca2db3da190fde077145756ba169bf4.tar.bz2 sequelpro-5914260a1ca2db3da190fde077145756ba169bf4.zip |
Add the ability to double click a tab to duplicate the connection in a new tab (equivalent to the 'Open Database in New Tab' menu item). Implements issue #1040.
Diffstat (limited to 'Frameworks/PSMTabBar/PSMTabBarControl.m')
-rw-r--r-- | Frameworks/PSMTabBar/PSMTabBarControl.m | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/Frameworks/PSMTabBar/PSMTabBarControl.m b/Frameworks/PSMTabBar/PSMTabBarControl.m index 028dc84b..a38c50b0 100644 --- a/Frameworks/PSMTabBar/PSMTabBarControl.m +++ b/Frameworks/PSMTabBar/PSMTabBarControl.m @@ -471,8 +471,6 @@ [self update]; } - - - (id)createNewTabTarget { return _createNewTabTarget; @@ -495,7 +493,25 @@ [[self addTabButton] setAction:selector]; } +- (id)doubleClickTarget +{ + return _doubleClickTarget; +} + +- (void)setDoubleClickTarget:(id)object +{ + _doubleClickTarget = object; +} + +- (SEL)doubleClickAction +{ + return _doubleClickAction; +} +- (void)setDoubleClickAction:(SEL)selector +{ + _doubleClickAction = selector; +} - (NSInteger)cellMinWidth { @@ -1327,6 +1343,11 @@ [cell setCloseButtonOver:NO]; [cell setCloseButtonPressed:YES]; _closeClicked = YES; + } + else if ([theEvent clickCount] == 2) { + [cell setCloseButtonOver:NO]; + + [_doubleClickTarget performSelector:_doubleClickAction withObject:cell]; } else { [cell setCloseButtonPressed:NO]; if (_selectsTabsOnMouseDown) { |