[fIcon release];
- [fRegularImage release];
- [fSelectedImage release];
[super dealloc];
}
[fIcon release];
fIcon = [image retain];
- if (fRegularImage)
- {
- [fRegularImage release];
- fRegularImage = nil;
- }
- if (fSelectedImage)
- {
- [fSelectedImage release];
- fSelectedImage = nil;
- }
-
[self setSelectedTab: fSelected];
}
fSelected = selected;
NSImage * tabImage;
- BOOL createImage = NO;
if (fSelected)
- {
- if (!fSelectedImage)
- {
- fSelectedImage = [NSColor currentControlTint] == NSGraphiteControlTint
- ? [[NSImage imageNamed: @"InfoTabBackGraphite.png"] copy] : [[NSImage imageNamed: @"InfoTabBackBlue.png"] copy];
- createImage = YES;
- }
- tabImage = fSelectedImage;
- }
+ tabImage = [NSColor currentControlTint] == NSGraphiteControlTint
+ ? [[NSImage imageNamed: @"InfoTabBackGraphite.png"] copy] : [[NSImage imageNamed: @"InfoTabBackBlue.png"] copy];
else
- {
- if (!fRegularImage)
- {
- fRegularImage = [[NSImage imageNamed: @"InfoTabBack.png"] copy];
- createImage = YES;
- }
- tabImage = fRegularImage;
- }
+ tabImage = [[NSImage imageNamed: @"InfoTabBack.png"] copy];
- if (createImage)
+ if (fIcon)
{
- if (fIcon)
- {
- NSSize iconSize = [fIcon size], tabSize = [tabImage size];
- NSPoint point = NSMakePoint(floorf((tabSize.width - iconSize.width) * 0.5),
- floorf((tabSize.height - iconSize.height) * 0.5));
-
- [tabImage lockFocus];
- [fIcon compositeToPoint: point operation: NSCompositeSourceOver];
- [tabImage unlockFocus];
- }
+ NSSize iconSize = [fIcon size], tabSize = [tabImage size];
+ NSPoint point = NSMakePoint(floorf((tabSize.width - iconSize.width) * 0.5),
+ floorf((tabSize.height - iconSize.height) * 0.5));
+
+ [tabImage lockFocus];
+ [fIcon compositeToPoint: point operation: NSCompositeSourceOver];
+ [tabImage unlockFocus];
}
[self setImage: tabImage];
+ [tabImage release];
}
- (void) updateControlTint: (NSNotification *) notification
{
- [fSelectedImage release];
- fSelectedImage = nil;
-
if (fSelected)
[self setSelectedTab: YES];
}