Suppress warnings and remove unneeded #if-endif

This commit is contained in:
Kazuki Sakamoto
2015-12-27 23:00:08 -08:00
parent e268fb8d67
commit 8015cac16f
4 changed files with 6 additions and 24 deletions
@@ -393,12 +393,7 @@ void MyNSDrawWindowBackground(NSRect rect)
if ([cell closeButtonPressed]) closeButton = metalCloseButtonDown;
closeButtonSize = [closeButton size];
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
[closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0 respectFlipped:YES hints:nil];
#else
[closeButton setFlipped:YES];
[closeButton drawAtPoint:closeButtonRect.origin fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
#endif
// scoot label over
labelPosition += closeButtonSize.width + kPSMTabBarCellPadding;
@@ -43,12 +43,7 @@
NSSize imageSize = [image size];
rect.origin.x = NSMidX(rect) - (imageSize.width * 0.5);
rect.origin.y = NSMidY(rect) - (imageSize.height * 0.5);
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
[image drawInRect:rect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0 respectFlipped:YES hints:nil];
#else
[image setFlipped:YES];
[image drawAtPoint:rect.origin fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
#endif
}
- (void)mouseDown:(NSEvent *)event
@@ -389,13 +389,8 @@
if ([cell closeButtonPressed]) closeButton = unifiedCloseButtonDown;
closeButtonSize = [closeButton size];
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
[closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0 respectFlipped:YES hints:nil];
#else
[closeButton setFlipped:YES];
[closeButton drawAtPoint:closeButtonRect.origin fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
#endif
// scoot label over
labelPosition += closeButtonSize.width + kPSMTabBarCellPadding;
}
@@ -379,16 +379,13 @@ void YosemiteNSDrawWindowBackground(NSRect rect, NSColor *color)
if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) {
NSSize closeButtonSize = NSZeroSize;
NSRect closeButtonRect = [cell closeButtonRectForFrame:cellFrame];
NSImage * closeButton = nil;
NSImage *button = nil;
closeButton = nil;
if ([cell closeButtonOver]) closeButton = closeButtonOver;
if ([cell closeButtonPressed]) closeButton = closeButtonDown;
closeButtonSize = [closeButton size];
[closeButton setFlipped:YES];
[closeButton drawAtPoint:closeButtonRect.origin fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
if ([cell closeButtonOver]) button = closeButtonOver;
if ([cell closeButtonPressed]) button = closeButtonDown;
closeButtonSize = [button size];
[button drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0 respectFlipped:YES hints:nil];
}
// object counter