aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/PSMTabBar
diff options
context:
space:
mode:
Diffstat (limited to 'Frameworks/PSMTabBar')
-rw-r--r--Frameworks/PSMTabBar/PSMTabBarControl.h12
-rw-r--r--Frameworks/PSMTabBar/PSMTabBarControl.m34
2 files changed, 40 insertions, 6 deletions
diff --git a/Frameworks/PSMTabBar/PSMTabBarControl.h b/Frameworks/PSMTabBar/PSMTabBarControl.h
index d734f3c8..2ac8474a 100644
--- a/Frameworks/PSMTabBar/PSMTabBarControl.h
+++ b/Frameworks/PSMTabBar/PSMTabBarControl.h
@@ -89,6 +89,8 @@ enum {
BOOL _allowsBackgroundTabClosing;
BOOL _selectsTabsOnMouseDown;
BOOL _createsTabOnDoubleClick;
+ id _createNewTabTarget;
+ SEL _createNewTabAction;
// vertical tab resizing
BOOL _allowsResizing;
@@ -136,6 +138,12 @@ enum {
- (void)setHideForSingleTab:(BOOL)value;
- (BOOL)showAddTabButton;
- (void)setShowAddTabButton:(BOOL)value;
+
+- (id)createNewTabTarget;
+- (void)setCreateNewTabTarget:(id)object;
+- (SEL)createNewTabAction;
+- (void)setCreateNewTabAction:(SEL)selector;
+
- (NSInteger)cellMinWidth;
- (void)setCellMinWidth:(NSInteger)value;
- (NSInteger)cellMaxWidth;
@@ -152,8 +160,8 @@ enum {
- (void)setAllowsResizing:(BOOL)value;
- (BOOL)selectsTabsOnMouseDown;
- (void)setSelectsTabsOnMouseDown:(BOOL)value;
-- (BOOL)doubleClickCreatesTab;
-- (void)setDoubleClickCreatesTab:(BOOL)value;
+- (BOOL)createsTabOnDoubleClick;
+- (void)setCreatesTabOnDoubleClick:(BOOL)value;
- (BOOL)automaticallyAnimates;
- (void)setAutomaticallyAnimates:(BOOL)value;
- (BOOL)alwaysShowActiveTab;
diff --git a/Frameworks/PSMTabBar/PSMTabBarControl.m b/Frameworks/PSMTabBar/PSMTabBarControl.m
index 4c92624e..a9268a78 100644
--- a/Frameworks/PSMTabBar/PSMTabBarControl.m
+++ b/Frameworks/PSMTabBar/PSMTabBarControl.m
@@ -472,6 +472,32 @@
[self update];
}
+
+
+- (id)createNewTabTarget
+{
+ return _createNewTabTarget;
+}
+
+- (void)setCreateNewTabTarget:(id)object
+{
+ _createNewTabTarget = object;
+ [[self addTabButton] setTarget:object];
+}
+
+- (SEL)createNewTabAction
+{
+ return _createNewTabAction;
+}
+
+- (void)setCreateNewTabAction:(SEL)selector
+{
+ _createNewTabAction = selector;
+ [[self addTabButton] setAction:selector];
+}
+
+
+
- (NSInteger)cellMinWidth
{
return _cellMinWidth;
@@ -567,12 +593,12 @@
_selectsTabsOnMouseDown = value;
}
-- (BOOL)doubleClickCreatesTab
+- (BOOL)createsTabOnDoubleClick;
{
return _createsTabOnDoubleClick;
}
-- (void)setDoubleClickCreatesTab:(BOOL)value
+- (void)setCreatesTabOnDoubleClick:(BOOL)value
{
_createsTabOnDoubleClick = value;
}
@@ -1311,8 +1337,8 @@
} else {
if ([theEvent clickCount] == 2) {
// fire create new tab
- if ([self doubleClickCreatesTab] && [[self addTabButton] target] != nil && [[self addTabButton] action] != nil) {
- [[[self addTabButton] target] performSelector:[[self addTabButton] action]];
+ if ([self createsTabOnDoubleClick] && [self createNewTabTarget] != nil && [self createNewTabAction] != nil) {
+ [[self createNewTabTarget] performSelector:[self createNewTabAction]];
}
return;
}