/* Copyright (C) 2002-2003, Jeffrey D. Argast. The authors make NO WARRANTY or representation, either express or implied, with respect to this software, its quality, accuracy, merchantability, or fitness for a particular purpose. This software is provided "AS IS", and you, its user, assume the entire risk as to its quality and accuracy. Permission is hereby granted to use, copy, modify, and distribute this software or portions thereof for any purpose, without fee, subject to these conditions: (1) If any part of the source code is distributed, then this statement must be included, with this copyright and no-warranty notice unaltered. (2) Permission for use of this software is granted only if the user accepts full responsibility for any undesirable consequences; the authors accept NO LIABILITY for damages of any kind. */ #import "CustomTabViewItem.h" @implementation CustomTabViewItem - (void) awakeFromNib { NSString* iconName = [super identifier]; fIcon = [[NSImage imageNamed:iconName] retain]; fIconSize = [fIcon size]; //[[super tabView] setToolTip:@"WOO HOOO"]; } - (void) dealloc { [fIcon release]; [super dealloc]; } - (NSSize) sizeOfLabel: (BOOL) computeMin { if ( computeMin ) { NSSize minSize = fIconSize; minSize.width = 5.0; // trial and error, this seems to work well return minSize; } return fIconSize; } - (void) drawLabel: (BOOL) shouldTruncateLabel inRect: (NSRect) labelRect { NSPoint p = labelRect.origin; p.y += fIconSize.height; if ( labelRect.size.width < fIconSize.width ) { float xDiff = (fIconSize.width - labelRect.size.width) / 2.0; p.x -= ceil(xDiff); } [fIcon compositeToPoint:p operation:NSCompositeSourceOver]; } @end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 3931 | Jeff Argast |
Fixed a hang when actin on large numbers of files Added an icon for xcode Switched to xcode Tweaked the icons in the tabs for panther |
||
#1 | 2732 | Jeff Argast | Initial submission of P4Cocoa |