aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/PSMTabBar/PSMTabBarCell.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-03-03 01:52:27 +0000
committerrowanbeentje <rowan@beent.je>2011-03-03 01:52:27 +0000
commit6fdc5d75e246d205ea97d65e7ddd8305df5003d8 (patch)
tree453dd831fa6e4a899906a89627de0f74459adaf8 /Frameworks/PSMTabBar/PSMTabBarCell.m
parent4422810afa93d3cbce76812cc50e45ef8634180b (diff)
downloadsequelpro-6fdc5d75e246d205ea97d65e7ddd8305df5003d8.tar.gz
sequelpro-6fdc5d75e246d205ea97d65e7ddd8305df5003d8.tar.bz2
sequelpro-6fdc5d75e246d205ea97d65e7ddd8305df5003d8.zip
- Fix all warnings in the PSMTabBar framework, including a fix for a 10.5 dragging issue and implementing Safari-style fadeout of previous window shell when dragging the last miniwindow out of a tab bar
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 5d585359..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.2f] 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];
}
}