diff options
Diffstat (limited to 'frontends/cocoa/PSMTabBarControl/PSMUnifiedTabStyle.m')
-rw-r--r-- | frontends/cocoa/PSMTabBarControl/PSMUnifiedTabStyle.m | 51 |
1 files changed, 18 insertions, 33 deletions
diff --git a/frontends/cocoa/PSMTabBarControl/PSMUnifiedTabStyle.m b/frontends/cocoa/PSMTabBarControl/PSMUnifiedTabStyle.m index 77be601be..98bf6c1e4 100644 --- a/frontends/cocoa/PSMTabBarControl/PSMUnifiedTabStyle.m +++ b/frontends/cocoa/PSMTabBarControl/PSMUnifiedTabStyle.m @@ -50,21 +50,6 @@ return self; } -- (void)dealloc { - [unifiedCloseButton release]; - [unifiedCloseButtonDown release]; - [unifiedCloseButtonOver release]; - [unifiedCloseDirtyButton release]; - [unifiedCloseDirtyButtonDown release]; - [unifiedCloseDirtyButtonOver release]; - [_addTabButtonImage release]; - [_addTabButtonPressedImage release]; - [_addTabButtonRolloverImage release]; - - [_objectCountStringAttributes release]; - - [super dealloc]; -} #pragma mark - #pragma mark Control Specific @@ -264,13 +249,13 @@ - (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell { NSString *contents = [NSString stringWithFormat:@"%lu", (unsigned long)[cell count]]; - return [[[NSMutableAttributedString alloc] initWithString:contents attributes:_objectCountStringAttributes] autorelease]; + return [[NSMutableAttributedString alloc] initWithString:contents attributes:_objectCountStringAttributes] ; } - (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell { NSMutableAttributedString *attrStr; NSString * contents = [cell stringValue]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; + attrStr = [[NSMutableAttributedString alloc] initWithString:contents] ; NSRange range = NSMakeRange(0, [contents length]); [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; @@ -278,7 +263,7 @@ // Paragraph Style for Truncating Long Text static NSMutableParagraphStyle *TruncatingTailParagraphStyle = nil; if(!TruncatingTailParagraphStyle) { - TruncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; + TruncatingTailParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy] ; [TruncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; } [attrStr addAttribute:NSParagraphStyleAttributeName value:TruncatingTailParagraphStyle range:range]; @@ -353,7 +338,7 @@ // rollover if([cell isHighlighted]) { [[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set]; - NSRectFillUsingOperation(aRect, NSCompositeSourceAtop); + NSRectFillUsingOperation(aRect, NSCompositingOperationSourceAtop); } // frame @@ -412,7 +397,7 @@ closeButtonRect.origin.y += closeButtonRect.size.height; } - [closeButton compositeToPoint:closeButtonRect.origin operation:NSCompositeSourceOver fraction:1.0]; + [closeButton drawAtPoint: closeButtonRect.origin fromRect: CGRectZero operation:NSCompositingOperationSourceOver fraction:1.0]; // scoot label over labelPosition += closeButtonSize.width + kPSMTabBarCellPadding; @@ -434,7 +419,7 @@ iconRect.origin.y -= (kPSMTabBarIconWidth - [icon size].height) / 2.0; } - [icon compositeToPoint:iconRect.origin operation:NSCompositeSourceOver fraction:1.0]; + [icon drawAtPoint:iconRect.origin fromRect: NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0]; // scoot label over labelPosition += iconRect.size.width + kPSMTabBarCellPadding; @@ -511,13 +496,13 @@ labelRect.origin.y += 4.0; NSMutableAttributedString *attrStr; NSString *contents = @"PSMTabBarControl"; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; + attrStr = [[NSMutableAttributedString alloc] initWithString:contents] ; NSRange range = NSMakeRange(0, [contents length]); [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; NSMutableParagraphStyle *centeredParagraphStyle = nil; if(!centeredParagraphStyle) { - centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [centeredParagraphStyle setAlignment:NSCenterTextAlignment]; + centeredParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy] ; + [centeredParagraphStyle setAlignment: NSTextAlignmentCenter]; } [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; [attrStr drawInRect:labelRect]; @@ -556,15 +541,15 @@ // self = [super initWithCoder:aDecoder]; //if (self) { if([aDecoder allowsKeyedCoding]) { - unifiedCloseButton = [[aDecoder decodeObjectForKey:@"unifiedCloseButton"] retain]; - unifiedCloseButtonDown = [[aDecoder decodeObjectForKey:@"unifiedCloseButtonDown"] retain]; - unifiedCloseButtonOver = [[aDecoder decodeObjectForKey:@"unifiedCloseButtonOver"] retain]; - unifiedCloseDirtyButton = [[aDecoder decodeObjectForKey:@"unifiedCloseDirtyButton"] retain]; - unifiedCloseDirtyButtonDown = [[aDecoder decodeObjectForKey:@"unifiedCloseDirtyButtonDown"] retain]; - unifiedCloseDirtyButtonOver = [[aDecoder decodeObjectForKey:@"unifiedCloseDirtyButtonOver"] retain]; - _addTabButtonImage = [[aDecoder decodeObjectForKey:@"addTabButtonImage"] retain]; - _addTabButtonPressedImage = [[aDecoder decodeObjectForKey:@"addTabButtonPressedImage"] retain]; - _addTabButtonRolloverImage = [[aDecoder decodeObjectForKey:@"addTabButtonRolloverImage"] retain]; + unifiedCloseButton = [aDecoder decodeObjectForKey:@"unifiedCloseButton"] ; + unifiedCloseButtonDown = [aDecoder decodeObjectForKey:@"unifiedCloseButtonDown"] ; + unifiedCloseButtonOver = [aDecoder decodeObjectForKey:@"unifiedCloseButtonOver"]; + unifiedCloseDirtyButton = [aDecoder decodeObjectForKey:@"unifiedCloseDirtyButton"] ; + unifiedCloseDirtyButtonDown = [aDecoder decodeObjectForKey:@"unifiedCloseDirtyButtonDown"] ; + unifiedCloseDirtyButtonOver = [aDecoder decodeObjectForKey:@"unifiedCloseDirtyButtonOver"] ; + _addTabButtonImage = [aDecoder decodeObjectForKey:@"addTabButtonImage"]; + _addTabButtonPressedImage = [aDecoder decodeObjectForKey:@"addTabButtonPressedImage"] ; + _addTabButtonRolloverImage = [aDecoder decodeObjectForKey:@"addTabButtonRolloverImage"] ; } //} return self; |