aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/PSMTabBar/PSMTabBarCell.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-03-07 20:12:52 +0000
committerstuconnolly <stuart02@gmail.com>2011-03-07 20:12:52 +0000
commit1e5288e9840e201a00bcb5ca3035d7aa807f1f8d (patch)
tree0c1a47953f57b71c41cc7a63e156629c6c9d645b /Frameworks/PSMTabBar/PSMTabBarCell.m
parent915a3831525bf3a9350648d82f86dd54ae366292 (diff)
downloadsequelpro-1e5288e9840e201a00bcb5ca3035d7aa807f1f8d.tar.gz
sequelpro-1e5288e9840e201a00bcb5ca3035d7aa807f1f8d.tar.bz2
sequelpro-1e5288e9840e201a00bcb5ca3035d7aa807f1f8d.zip
Bring outline view branch up to date with trunk (r3203:r3224).
Diffstat (limited to 'Frameworks/PSMTabBar/PSMTabBarCell.m')
-rw-r--r--Frameworks/PSMTabBar/PSMTabBarCell.m24
1 files changed, 15 insertions, 9 deletions
diff --git a/Frameworks/PSMTabBar/PSMTabBarCell.m b/Frameworks/PSMTabBar/PSMTabBarCell.m
index 7ecaa183..809d9061 100644
--- a/Frameworks/PSMTabBar/PSMTabBarCell.m
+++ b/Frameworks/PSMTabBar/PSMTabBarCell.m
@@ -28,7 +28,7 @@
_cellTrackingTag = 0;
_closeButtonOver = NO;
_closeButtonPressed = NO;
- _indicator = [[PSMProgressIndicator alloc] initWithFrame:NSMakeRect(0.0,0.0,kPSMTabBarIndicatorWidth,kPSMTabBarIndicatorWidth)];
+ _indicator = [[PSMProgressIndicator alloc] initWithFrame:NSMakeRect(0.0f,0.0f,kPSMTabBarIndicatorWidth,kPSMTabBarIndicatorWidth)];
[_indicator setStyle:NSProgressIndicatorSpinningStyle];
[_indicator setAutoresizingMask:NSViewMinYMargin];
_hasCloseButton = YES;
@@ -48,9 +48,9 @@
_isPlaceholder = YES;
if (!value) {
if ([controlView orientation] == PSMTabBarHorizontalOrientation) {
- frame.size.width = 0.0;
+ frame.size.width = 0.0f;
} else {
- frame.size.height = 0.0;
+ frame.size.height = 0.0f;
}
}
[self setFrame:frame];
@@ -348,7 +348,7 @@
{
if (_isPlaceholder) {
if (![_controlView usesSafariStyleDragging]) {
- [[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set];
+ [[NSColor colorWithCalibratedWhite:0.0f alpha:0.2f] set];
NSRectFillUsingOperation(cellFrame, NSCompositeSourceAtop);
}
return;
@@ -373,7 +373,7 @@
// scrubtastic
if ([_controlView allowsScrubbing] && ([theEvent modifierFlags] & NSAlternateKeyMask))
- [_controlView performSelector:@selector(tabClick:) withObject:self];
+ [_controlView tabClick:self];
// tell the control we only need to redraw the affected tab
[_controlView setNeedsDisplayInRect:NSInsetRect([self frame], -2, -2)];
@@ -410,7 +410,13 @@
// Draw the tab into a new image
NSImage *image = [[[NSImage alloc] initWithSize:cellFrame.size] autorelease];
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1060
+ [image setFlipped:YES];
+ [image lockFocus];
+#else
[image lockFocusFlipped:YES];
+#endif
[self setFrame:tabDrawFrame];
[(id <PSMTabStyle>)[(PSMTabBarControl *)_controlView style] drawTabCell:self];
[self setFrame:oldFrame];
@@ -418,12 +424,12 @@
// Add the indicator if appropriate
if (![[self indicator] isHidden]) {
- NSImage *pi = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"pi"]];
+ NSImage *pieImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"pi"]];
[image lockFocus];
NSPoint indicatorPoint = NSMakePoint([self frame].size.width - MARGIN_X - kPSMTabBarIndicatorWidth, MARGIN_Y);
- [pi compositeToPoint:indicatorPoint operation:NSCompositeSourceOver fraction:1.0];
+ [pieImage compositeToPoint:indicatorPoint operation:NSCompositeSourceOver fraction:1.0f];
[image unlockFocus];
- [pi release];
+ [pieImage release];
}
return image;
@@ -528,7 +534,7 @@
- (void)accessibilityPerformAction:(NSString *)action {
if ([action isEqualToString:NSAccessibilityPressAction]) {
// this tab was selected
- [_controlView performSelector:@selector(tabClick:) withObject:self];
+ [_controlView tabClick:self];
}
}