File:  [mozdev] / chimera / IconTabViewItem.m
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Wed Mar 13 06:44:38 2002 UTC (15 years, 7 months ago) by macserv
Branches: MAIN
CVS tags: HEAD
A couple ui tweaks, but the main thing is the icons in the sidebar tabs.  Also, a bit of Project cleanup.

//
//  IconTabViewItem.m
//  Chimera
//
//  Created by Matt L.  Judy on Sun Mar 10 2002.
//  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
//

#import "IconTabViewItem.h"


@implementation IconTabViewItem

-(id)initWithIdentifier:(id)identifier withTabIcon:(NSImage *)tabIcon
{
    if ( (self = [super initWithIdentifier:identifier]) ) {
        [self setTabIcon:tabIcon];
    }
    return self;
}

- (NSSize)sizeOfLabel:(BOOL)computeMin
{
    return( NSMakeSize(15,15) );
}

-(void)drawLabel:(BOOL)shouldTruncateLabel inRect:(NSRect)tabRect
{
    NSPoint	drawPoint = NSMakePoint( (tabRect.origin.x), (tabRect.origin.y + 15) );
    [[self tabIcon] compositeToPoint:drawPoint operation:NSCompositeSourceOver];    
}

-(NSImage *)tabIcon { return _tabIcon; }
-(void)setTabIcon:(NSImage *)newIcon
{
    [_tabIcon autorelease];
    _tabIcon = [newIcon copy];
}


@end

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>