File:  [mozdev] / chimera / IconTabViewItem.m
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Mon Mar 11 09:23:36 2002 UTC (15 years, 7 months ago) by macserv
Branches: MAIN
CVS tags: HEAD
Adding some groundwork for the NSTabViewItem subclass that will draw icons in its tab labels.  Added a line to the BrowserWindowController that creates a dummy instance of this subclass.  It will be removed when things work better.  Added the tab icons themselves.  Adding some of the updated toobar icons. The BrowserWindowController has a new outlet to the sidebar tabview, and the project was touched, of course.

//
//  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,30) );
}

-(void)drawLabel:(BOOL)shouldTruncateLabel inRect:(NSRect)tabRect
{
    [[self tabIcon] compositeToPoint:tabRect.origin operation:NSCompositeSourceOver];    
}

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


@end

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