aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-07-05 09:05:25 +0000
committerrowanbeentje <rowan@beent.je>2010-07-05 09:05:25 +0000
commit74ad9f4532e30ee859cf0773b76e5a1b4f73e5db (patch)
tree6e2493f4d0099c39e4875d615f7e6466dab6c732
parent1f17c71b8558565126b32a1d1d3da4e6b0565153 (diff)
downloadsequelpro-74ad9f4532e30ee859cf0773b76e5a1b4f73e5db.tar.gz
sequelpro-74ad9f4532e30ee859cf0773b76e5a1b4f73e5db.tar.bz2
sequelpro-74ad9f4532e30ee859cf0773b76e5a1b4f73e5db.zip
Tab tweaks:
- Improve hideForSingleTab: settings changes to only update the tab bar if only one tab exists; fixes tab sizing on drag start caused by placeholder cell/update tab bar display conflict - Improve tab drag location detection, particularly when dragging tabs into a new tab bar; drags into new tab bars now respond quickly and correctly
-rw-r--r--Frameworks/PSMTabBar/PSMTabBarControl.m4
-rw-r--r--Frameworks/PSMTabBar/PSMTabDragAssistant.m5
2 files changed, 7 insertions, 2 deletions
diff --git a/Frameworks/PSMTabBar/PSMTabBarControl.m b/Frameworks/PSMTabBar/PSMTabBarControl.m
index 6753bc08..53e48729 100644
--- a/Frameworks/PSMTabBar/PSMTabBarControl.m
+++ b/Frameworks/PSMTabBar/PSMTabBarControl.m
@@ -450,7 +450,9 @@
- (void)setHideForSingleTab:(BOOL)value
{
_hideForSingleTab = value;
- [self update];
+ if ([_cells count] == 1) {
+ [self update];
+ }
}
- (BOOL)showAddTabButton
diff --git a/Frameworks/PSMTabBar/PSMTabDragAssistant.m b/Frameworks/PSMTabBar/PSMTabDragAssistant.m
index 7ebada1a..1e7b22a1 100644
--- a/Frameworks/PSMTabBar/PSMTabDragAssistant.m
+++ b/Frameworks/PSMTabBar/PSMTabDragAssistant.m
@@ -810,6 +810,9 @@ static PSMTabDragAssistant *sharedDragAssistant = nil;
// Determine the index of the tab the dragged tab is over
NSUInteger overCellIndex = [cells indexOfObject:overCell];
+
+ // Determine the index of the current target
+ NSUInteger currentTargetCellIndex = _targetCell?[cells indexOfObject:_targetCell]:NSUIntegerMax;
// Ensure that drag changes aren't as a result of an animation
NSInteger currentCellStep = [[cells objectAtIndex:(overCellIndex - 1)] currentStep];
@@ -817,7 +820,7 @@ static PSMTabDragAssistant *sharedDragAssistant = nil;
// Center of the tab is past the edge of the tab to the left
if (targetPoint.x < (overCellRect.origin.x + overCellRect.size.width)
- && targetPoint.x > (overCellRect.origin.x + overCellRect.size.width/2.0))
+ && currentTargetCellIndex > overCellIndex)
{
[self setTargetCell:[cells objectAtIndex:(overCellIndex - 1)]];