Show
Ignore:
Timestamp:
04/20/05 19:37:46 (4 years ago)
Author:
eridius
Message:

Remove all trailing whitespace from lines
Remove indentation on blank lines

Files:

Legend:

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

    r2054 r2558  
    5858{ 
    5959    static BOOL haveLoadedImages = NO; 
    60      
     60 
    6161    [super init]; 
    62          
     62 
    6363    //Share these images between all AICustomTabCell instances 
    6464    if(!haveLoadedImages){ 
     
    6666                tabFrontMiddle = [[NSImage imageNamed:@"aquaTabMiddle"] retain]; 
    6767                tabFrontRight = [[NSImage imageNamed:@"aquaTabRight"] retain]; 
    68                  
     68 
    6969                tabCloseFront = [[NSImage imageNamed:@"aquaTabClose"] retain]; 
    7070                tabCloseBack = [[NSImage imageNamed:@"aquaTabCloseBack"] retain]; 
     
    7474                leftCapSize = [tabFrontLeft size]; 
    7575                rightCapSize = [tabFrontRight size]; 
    76                  
     76 
    7777        haveLoadedImages = YES; 
    7878    } 
    79          
     79 
    8080    tabViewItem = [inTabViewItem retain]; 
    8181        view = inView; 
     
    8888    closeTrackingTag = 0; 
    8989        toolTipTag = 0; 
    90          
     90 
    9191    return(self); 
    9292} 
     
    106106        int width = leftCapSize.width + [[self attributedLabel] size].width + rightCapSize.width + 
    107107        (TAB_CLOSE_LEFTPAD + [[tabViewItem icon] size].width + TAB_CLOSE_RIGHTPAD) + TAB_RIGHT_PAD; 
    108          
     108 
    109109    return( NSMakeSize((width > TAB_MIN_WIDTH ? width : TAB_MIN_WIDTH), leftCapSize.height) ); 
    110110} 
     
    115115    int tabWidth = [tab size].width; 
    116116    int ourWidth = [self size].width; 
    117          
     117 
    118118    if(tabWidth > ourWidth){ 
    119119        return(NSOrderedAscending); 
    120          
     120 
    121121    }else if(tabWidth < ourWidth){ 
    122122        return(NSOrderedDescending); 
    123          
     123 
    124124    }else{ 
    125125        return(NSOrderedSame); 
    126          
     126 
    127127    } 
    128128} 
     
    152152        NSSize  imageSize = [[tabViewItem icon] size]; 
    153153        int             centerY = (frame.size.height - imageSize.height) / 2.0; 
    154          
     154 
    155155        return(NSMakeRect(frame.origin.x + leftCapSize.width + TAB_CLOSE_LEFTPAD, 
    156156                                          frame.origin.y + centerY + TAB_CLOSE_Y_OFFSET, 
     
    226226    NSSize      labelSize; 
    227227        NSPoint destPoint; 
    228      
     228 
    229229    //Pre-calc some dimensions 
    230230    labelSize = [tabViewItem sizeOfLabel:NO]; 
     
    232232    middleRightEdge = (rect.origin.x + rect.size.width - rightCapSize.width); 
    233233    middleLeftEdge = (rect.origin.x + leftCapSize.width); 
    234          
     234 
    235235    //Background 
    236236    if(selected && !ignoreSelection){ 
    237237        //Draw the left cap 
    238238        [tabFrontLeft compositeToPoint:NSMakePoint(rect.origin.x, rect.origin.y) operation:NSCompositeSourceOver]; 
    239                  
     239 
    240240        //Draw the middle 
    241241        sourceRect = NSMakeRect(0, 0, [tabFrontMiddle size].width, [tabFrontMiddle size].height); 
    242242        destRect = NSMakeRect(middleLeftEdge, rect.origin.y, sourceRect.size.width, sourceRect.size.height); 
    243                  
     243 
    244244        while(destRect.origin.x < middleRightEdge){ 
    245245            if((destRect.origin.x + destRect.size.width) > middleRightEdge){ 
     
    249249            destRect.origin.x += destRect.size.width; 
    250250        } 
    251                  
     251 
    252252        //Draw the right cap 
    253253        [tabFrontRight compositeToPoint:NSMakePoint(middleRightEdge, rect.origin.y) operation:NSCompositeSourceOver]; 
    254                  
     254 
    255255    }else if(highlighted){ 
    256256        [[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set]; 
    257257        [NSBezierPath fillRect:NSMakeRect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height)]; 
    258258    } 
    259          
     259 
    260260        //We'll display our close icon if the user is hovering.  Otherwise, we display the tab specified icon 
    261261        NSImage *leftIcon = [tabViewItem icon]; 
    262         if((hoveringClose && (selected || allowsInactiveTabClosing || ( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSCommandKeyMask ))) || !leftIcon){          
     262        if((hoveringClose && (selected || allowsInactiveTabClosing || ( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSCommandKeyMask ))) || !leftIcon){ 
    263263                if(hoveringClose){ 
    264264                        leftIcon = (trackingClose ? tabCloseFrontPressed : tabCloseFrontRollover); 
     
    278278        rect.origin.x += offsetX; 
    279279        rect.size.width -= offsetX + TAB_RIGHT_PAD; 
    280          
     280 
    281281        //Draw our label 
    282282        destRect = NSMakeRect(rect.origin.x, 
     
    285285                                                  rect.size.height - ((rect.size.height - labelSize.height) / 2.0)); 
    286286    if(TAB_SELECTED_HIGHER && !ignoreSelection && selected) destRect.origin.y += 1.0; 
    287         [[self attributedLabel] drawInRect:destRect];   
     287        [[self attributedLabel] drawInRect:destRect]; 
    288288} 
    289289 
     
    292292{ 
    293293        NSString        *label = [tabViewItem label]; 
    294          
     294 
    295295        if(![label isEqualToString:[attributedLabel string]] || wasEnabled != [tabViewItem isEnabled] ){ 
    296296                wasEnabled = [tabViewItem isEnabled]; 
     
    299299                [paragraphStyle setAlignment:NSCenterTextAlignment]; 
    300300                [paragraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; 
    301                  
     301 
    302302                //Update the attributed string 
    303303                [attributedLabel release]; 
     
    309309                                nil]]; 
    310310        } 
    311          
     311 
    312312        return(attributedLabel); 
    313313} 
     
    324324                           assumeInside:NSPointInRect(cursorLocation, trackRect)]; 
    325325    [self setHighlighted:NSPointInRect(cursorLocation, trackRect)]; 
    326          
     326 
    327327    closeTrackingTag = [view addTrackingRect:[self _closeButtonRect] 
    328328                                       owner:self 
     
    349349//              [[tabViewItem tabView] selectTabViewItem:tabViewItem]; 
    350350//      } 
    351          
     351 
    352352    //Set ourself (or our close button) as hovered 
    353353    if((allowsInactiveTabClosing || selected || ( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSCommandKeyMask )) && 
     
    378378           (SHOW_CLOSE_BUTTON_FOR_SINGLE_TAB || [[tabViewItem tabView] numberOfTabViewItems] != 1) && 
    379379           NSPointInRect([controlView convertPoint:[theEvent locationInWindow] fromView:nil], [self _closeButtonRect])){ 
    380                  
     380 
    381381        [self trackMouse:theEvent inRect:[self _closeButtonRect] ofView:controlView untilMouseUp:YES]; 
    382382        return(YES); 
    383                  
     383 
    384384    }else{ 
    385385        return(NO); 
    386                  
     386 
    387387    } 
    388388} 
     
    394394    hoveringClose = YES; 
    395395    [controlView setNeedsDisplayInRect:[self _closeButtonRect]]; 
    396          
     396 
    397397    return(YES); 
    398398} 
     
    402402{ 
    403403    BOOL        hovering = NSPointInRect(currentPoint, [self _closeButtonRect]); 
    404          
     404 
    405405    if(hoveringClose != hovering){ 
    406406        hoveringClose = hovering; 
    407407        [controlView setNeedsDisplayInRect:[self _closeButtonRect]]; 
    408408    } 
    409      
     409 
    410410    return(YES); 
    411411} 
     
    415415{ 
    416416    BOOL        hovering = NSPointInRect(stopPoint, [self _closeButtonRect]); 
    417          
     417 
    418418        //Closes all the other tabs in the current window if option is held down (And we have more than one tab) 
    419419        if(hovering && ([[[controlView window] currentEvent] modifierFlags] & NSAlternateKeyMask) && [[tabViewItem tabView] numberOfTabViewItems] > 1){ 
     
    422422        [(AICustomTabsView *)controlView closeTab:self]; 
    423423    } 
    424          
     424 
    425425    hoveringClose = NO; 
    426426    trackingClose = NO;