Show
Ignore:
Timestamp:
10/21/04 14:14:19 (4 years ago)
Author:
timothy
Message:

Latest Adium tab code. Merged our tooltip code in.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/AICustomTabsView.m

    r1823 r2039  
    154154        allowsTabRearranging = inValue; 
    155155} 
    156  
    157156- (BOOL)allowsTabRearranging 
    158157{ 
     
    229228                //Account for shifting 
    230229                if(currentIndex < newIndex) newIndex--; 
    231  
     230                 
    232231                //Move via a remove and add :( 
    233232                [tabCell retain]; 
     
    235234                [tabCellArray insertObject:tabCell atIndex:newIndex]; 
    236235                [tabCell release]; 
    237  
     236                 
    238237                //Move the tab 
    239238                ignoreTabNumberChange = YES; 
     
    356355                 
    357356                //Create a new tab cell 
    358                 tabCell = [AICustomTabCell customTabForTabViewItem:tabViewItem]; 
     357                tabCell = [AICustomTabCell customTabForTabViewItem:tabViewItem customTabsView:self]; 
    359358                [tabCell setSelected:(tabViewItem == [tabView selectedTabViewItem])]; 
    360359                [tabCell setAllowsInactiveTabClosing:allowsInactiveTabClosing]; 
     
    434433    int                         totalTabWidth; 
    435434    int                         reducedWidth = 0; 
    436     float                     reduceThreshold = 1000000; 
     435    int                               reduceThreshold = 1000000; 
    437436 
    438437    //Get the total tab width 
     
    535534                tabDivider = [[NSImage imageNamed:@"aquaTabDivider"] retain]; 
    536535                tabBackground = [[NSImage imageNamed:@"aquaTabBackground"] retain]; 
    537  
    538536        haveLoadedImages = YES; 
    539537    } 
     
    625623    AICustomTabCell     *tabCell = [self tabAtPoint:clickLocation]; 
    626624         
    627         [tabView selectTabViewItem:[tabCell tabViewItem]]; 
    628          
    629625    //Pass this on to our delegate 
    630626    if(tabCell && [delegate respondsToSelector:@selector(customTabView:menuForTabViewItem:)]){ 
     
    633629    return(nil); 
    634630} 
     631 
    635632 
    636633//Tooltip ------------------------------------------------------------------------------------------------------ 
     
    640637        NSPoint         location = [self convertPoint:point fromView:nil]; 
    641638    AICustomTabCell     *tabCell = [self tabAtPoint:location]; 
    642  
    643    //Pass this on to our delegate 
     639         
     640       //Pass this on to our delegate 
    644641    if(tabCell && [delegate respondsToSelector:@selector(customTabView:toolTipForTabViewItem:)]){ 
    645642        return([delegate customTabView:self toolTipForTabViewItem:[tabCell tabViewItem]]); 
     
    661658    if(tabCell = [self tabAtPoint:lastClickLocation]){ 
    662659        if(![tabCell willTrackMouse:theEvent inRect:[tabCell frame] ofView:self]){ 
    663 //                      if(! ( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSCommandKeyMask ) ){ //Allow background dragging 
     660//                      if(!( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSCommandKeyMask )){ //Allow background dragging 
    664661                [tabView selectTabViewItem:[tabCell tabViewItem]]; 
    665662//            } 
     
    704701} 
    705702 
    706 //Dragging ------------------------------------------------------------------------------------------------------------- 
    707 #pragma mark Dragging 
    708703//Return the drag types we accept 
    709704- (NSArray *)acceptableDragTypes 
     
    824819                [[AICustomTabDragging sharedInstance] setDestinationTabView:nil]; 
    825820                [self smoothlyArrangeTabs]; 
    826                 [self resetCursorTracking]; 
    827821                 
    828822                //Pass event along to the windowController 
     
    907901        while((tabCell = [enumerator nextObject])){             
    908902            NSRect trackRect = [tabCell frame]; 
    909             [tabCell addTrackingRectsInView:self withFrame:trackRect cursorLocation:localPoint]; 
     903            [tabCell addTrackingRectsWithFrame:trackRect cursorLocation:localPoint]; 
    910904        } 
    911905                 
     
    923917                enumerator = [tabCellArray objectEnumerator]; 
    924918                while((tabCell = [enumerator nextObject])){ 
    925                         [tabCell removeTrackingRectsFromView:self]; 
     919                        [tabCell removeTrackingRects]; 
    926920                } 
    927921