diff options
author | rowanbeentje <rowan@beent.je> | 2014-02-10 01:38:10 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2014-02-10 01:38:10 +0000 |
commit | 5c8a9b1a15ffd1ecf96340d3f43a4ca916665b9b (patch) | |
tree | 77acc8717172974934b8127a1121bf38fd7159e5 /Frameworks/PSMTabBar/Styles | |
parent | 38ca716543d7601a4e29823fb4578b96c599cf81 (diff) | |
download | sequelpro-5c8a9b1a15ffd1ecf96340d3f43a4ca916665b9b.tar.gz sequelpro-5c8a9b1a15ffd1ecf96340d3f43a4ca916665b9b.tar.bz2 sequelpro-5c8a9b1a15ffd1ecf96340d3f43a4ca916665b9b.zip |
Fix run-time warnings due to use of deprecated [NSImage compositeToPoint:...] operations
Diffstat (limited to 'Frameworks/PSMTabBar/Styles')
-rw-r--r-- | Frameworks/PSMTabBar/Styles/PSMAdiumTabStyle.m | 14 | ||||
-rw-r--r-- | Frameworks/PSMTabBar/Styles/PSMAquaTabStyle.m | 15 | ||||
-rw-r--r-- | Frameworks/PSMTabBar/Styles/PSMCardTabStyle.m | 16 | ||||
-rw-r--r-- | Frameworks/PSMTabBar/Styles/PSMMetalTabStyle.m | 13 | ||||
-rw-r--r-- | Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m | 14 | ||||
-rw-r--r-- | Frameworks/PSMTabBar/Styles/PSMUnifiedTabStyle.m | 16 |
6 files changed, 25 insertions, 63 deletions
diff --git a/Frameworks/PSMTabBar/Styles/PSMAdiumTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMAdiumTabStyle.m index 3bda9cf5..758ebe21 100644 --- a/Frameworks/PSMTabBar/Styles/PSMAdiumTabStyle.m +++ b/Frameworks/PSMTabBar/Styles/PSMAdiumTabStyle.m @@ -623,13 +623,9 @@ closeButtonOrIcon = ([cell isEdited] ? _closeDirtyButton : _closeButton); drawingRect = closeButtonRect; } - - if ([controlView isFlipped]) { - drawingRect.origin.y += drawingRect.size.height; - } - [closeButtonOrIcon compositeToPoint:drawingRect.origin operation:NSCompositeSourceOver fraction:1.0]; - + [closeButtonOrIcon drawInRect:drawingRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; + // scoot label over switch (orientation) { @@ -662,12 +658,8 @@ NSRect iconRect = [self iconRectForTabCell:cell]; NSImage *icon = [[[cell representedObject] identifier] icon]; - if ([controlView isFlipped]) { - iconRect.origin.y += iconRect.size.height; - } + [icon drawInRect:iconRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; - [icon compositeToPoint:iconRect.origin operation:NSCompositeSourceOver fraction:1.0]; - // scoot label over by the size of the standard close button switch (orientation) { diff --git a/Frameworks/PSMTabBar/Styles/PSMAquaTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMAquaTabStyle.m index 901f3b4a..161dbe8d 100644 --- a/Frameworks/PSMTabBar/Styles/PSMAquaTabStyle.m +++ b/Frameworks/PSMTabBar/Styles/PSMAquaTabStyle.m @@ -451,12 +451,8 @@ closeButtonSize = [closeButton size]; - if ([controlView isFlipped]) { - closeButtonRect.origin.y += closeButtonRect.size.height; - } - - [closeButton compositeToPoint:closeButtonRect.origin operation:NSCompositeSourceOver fraction:1.0]; - + [closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; + // scoot label over labelPosition += closeButtonSize.width + kPSMTabBarCellPadding; } @@ -465,9 +461,6 @@ if ([cell hasIcon]) { NSRect iconRect = [self iconRectForTabCell:cell]; NSImage *icon = [[[cell representedObject] identifier] icon]; - if ([controlView isFlipped]) { - iconRect.origin.y += iconRect.size.height; - } // center in available space (in case icon image is smaller than kPSMTabBarIconWidth) if ([icon size].width < kPSMTabBarIconWidth) { @@ -478,8 +471,8 @@ iconRect.origin.y -= (kPSMTabBarIconWidth - [icon size].height) / 2.0; } - [icon compositeToPoint:iconRect.origin operation:NSCompositeSourceOver fraction:1.0]; - + [icon drawInRect:iconRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; + // scoot label over labelPosition += iconRect.size.width + kPSMTabBarCellPadding; } diff --git a/Frameworks/PSMTabBar/Styles/PSMCardTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMCardTabStyle.m index 56c3a173..44f5b098 100644 --- a/Frameworks/PSMTabBar/Styles/PSMCardTabStyle.m +++ b/Frameworks/PSMTabBar/Styles/PSMCardTabStyle.m @@ -455,12 +455,9 @@ if ([cell closeButtonPressed]) closeButton = [cell isEdited] ? unifiedCloseDirtyButtonDown : unifiedCloseButtonDown; closeButtonSize = [closeButton size]; - if ([controlView isFlipped]) { - closeButtonRect.origin.y += closeButtonRect.size.height; - } - - [closeButton compositeToPoint:closeButtonRect.origin operation:NSCompositeSourceOver fraction:1.0]; - + + [closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; + // scoot label over labelPosition += closeButtonSize.width + kPSMTabBarCellPadding; } @@ -469,9 +466,6 @@ if ([cell hasIcon]) { NSRect iconRect = [self iconRectForTabCell:cell]; NSImage *icon = [[[cell representedObject] identifier] icon]; - if ([controlView isFlipped]) { - iconRect.origin.y += iconRect.size.height; - } // center in available space (in case icon image is smaller than kPSMTabBarIconWidth) if ([icon size].width < kPSMTabBarIconWidth) { @@ -481,8 +475,8 @@ iconRect.origin.y -= (kPSMTabBarIconWidth - [icon size].height) / 2.0; } - [icon compositeToPoint:iconRect.origin operation:NSCompositeSourceOver fraction:1.0]; - + [icon drawInRect:iconRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; + // scoot label over labelPosition += iconRect.size.width + kPSMTabBarCellPadding; } diff --git a/Frameworks/PSMTabBar/Styles/PSMMetalTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMMetalTabStyle.m index db9bbd86..ace79cf0 100644 --- a/Frameworks/PSMTabBar/Styles/PSMMetalTabStyle.m +++ b/Frameworks/PSMTabBar/Styles/PSMMetalTabStyle.m @@ -462,12 +462,9 @@ if ([cell closeButtonPressed]) closeButton = [cell isEdited] ? metalCloseDirtyButtonDown : metalCloseButtonDown; closeButtonSize = [closeButton size]; - if ([controlView isFlipped]) { - closeButtonRect.origin.y += closeButtonRect.size.height; - } - - [closeButton compositeToPoint:closeButtonRect.origin operation:NSCompositeSourceOver fraction:1.0]; - + + [closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; + // scoot label over labelPosition += closeButtonSize.width + kPSMTabBarCellPadding; } @@ -489,8 +486,8 @@ iconRect.origin.y -= (kPSMTabBarIconWidth - [icon size].height)/2.0; } - [icon compositeToPoint:iconRect.origin operation:NSCompositeSourceOver fraction:1.0]; - + [icon drawInRect:iconRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; + // scoot label over labelPosition += iconRect.size.width + kPSMTabBarCellPadding; } diff --git a/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m index 9a4026ec..cf393bdb 100644 --- a/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m +++ b/Frameworks/PSMTabBar/Styles/PSMSequelProTabStyle.m @@ -717,11 +717,7 @@ if ([cell closeButtonOver]) closeButton = [cell isEdited] ? sequelProCloseDirtyButtonOver : sequelProCloseButtonOver; if ([cell closeButtonPressed]) closeButton = [cell isEdited] ? sequelProCloseDirtyButtonDown : sequelProCloseButtonDown; - if ([controlView isFlipped]) { - closeButtonRect.origin.y += closeButtonRect.size.height; - } - - [closeButton compositeToPoint:closeButtonRect.origin operation:NSCompositeSourceOver fraction:1.0f]; + [closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; } // icon @@ -729,10 +725,6 @@ NSRect iconRect = [self iconRectForTabCell:cell]; NSImage *icon = [(id)[[cell representedObject] identifier] icon]; - if ([controlView isFlipped]) { - iconRect.origin.y += iconRect.size.height; - } - // center in available space (in case icon image is smaller than kPSMTabBarIconWidth) if ([icon size].width < kPSMTabBarIconWidth) { iconRect.origin.x += (kPSMTabBarIconWidth - [icon size].width)/2.0f; @@ -741,8 +733,8 @@ iconRect.origin.y -= (kPSMTabBarIconWidth - [icon size].height)/2.0f; } - [icon compositeToPoint:iconRect.origin operation:NSCompositeSourceOver fraction:1.0f]; - + [icon drawInRect:iconRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; + // scoot label over insetLabelWidth += iconRect.size.width + kPSMTabBarCellPadding; } diff --git a/Frameworks/PSMTabBar/Styles/PSMUnifiedTabStyle.m b/Frameworks/PSMTabBar/Styles/PSMUnifiedTabStyle.m index 76b5efc1..dcf99545 100644 --- a/Frameworks/PSMTabBar/Styles/PSMUnifiedTabStyle.m +++ b/Frameworks/PSMTabBar/Styles/PSMUnifiedTabStyle.m @@ -430,12 +430,9 @@ if ([cell closeButtonPressed]) closeButton = [cell isEdited] ? unifiedCloseDirtyButtonDown : unifiedCloseButtonDown; closeButtonSize = [closeButton size]; - if ([controlView isFlipped]) { - closeButtonRect.origin.y += closeButtonRect.size.height; - } - - [closeButton compositeToPoint:closeButtonRect.origin operation:NSCompositeSourceOver fraction:1.0]; - + + [closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; + // scoot label over labelPosition += closeButtonSize.width + kPSMTabBarCellPadding; } @@ -444,9 +441,6 @@ if ([cell hasIcon]) { NSRect iconRect = [self iconRectForTabCell:cell]; NSImage *icon = [[[cell representedObject] identifier] icon]; - if ([controlView isFlipped]) { - iconRect.origin.y += iconRect.size.height; - } // center in available space (in case icon image is smaller than kPSMTabBarIconWidth) if ([icon size].width < kPSMTabBarIconWidth) { @@ -456,8 +450,8 @@ iconRect.origin.y -= (kPSMTabBarIconWidth - [icon size].height) / 2.0; } - [icon compositeToPoint:iconRect.origin operation:NSCompositeSourceOver fraction:1.0]; - + [icon drawInRect:iconRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f respectFlipped:YES hints:nil]; + // scoot label over labelPosition += iconRect.size.width + kPSMTabBarCellPadding; } |