Adium

Changeset 24075

Show
Ignore:
Timestamp:
06/26/2008 09:17:04 PM (7 months ago)
Author:
evands
Message:

Fixed handling of double-click-to-collapse-a-shelf. Fixes #10214 which I broke in [24064].

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/KNShelfSplitView.m

    r24064 r24075  
    222222} 
    223223 
    224 -(float)minimumShelfWidth 
     224-(void)setShelfWidthNoConstraints:(float)aWidth 
    225225{ 
    226         // The shelf can never be completely closed. We always have at least enough to show our resize thumb, otherwise 
    227         // if the delegate responds to shelfSplitView:validateWidth:, we use that width as our minimum shelf size 
    228         float                           minShelf = THUMB_WIDTH; 
    229         if( delegateHasValidateWidth ){ 
    230                 float                           requestedWidth = [delegate shelfSplitView:self validateWidth: 0]; 
    231                 if( requestedWidth > minShelf ){ 
    232                         minShelf = requestedWidth; 
    233                 } 
    234         } 
    235          
    236         return minShelf; 
     226        currentShelfWidth = aWidth; 
     227         
     228        [self recalculateSizes];         
    237229} 
    238230 
     
    429421                if([anEvent clickCount] == 2){ 
    430422                        if( (activeControlPart == CONTROL_PART_RESIZE_THUMB) || (activeControlPart == CONTROL_PART_RESIZE_BAR) ){ 
    431                                 float minShelfWidth = [self minimumShelfWidth]; 
    432                                 if (currentShelfWidth > minShelfWidth) { 
     423                                if (currentShelfWidth > NSWidth(resizeBarRect)) { 
    433424                                        prevShelfWidthBeforeDoubleClick = currentShelfWidth; 
    434                                         [self setShelfWidth:minShelfWidth]; 
     425                                        [self setShelfWidthNoConstraints:NSWidth(resizeBarRect)]; 
    435426                                } else { 
    436427                                        [self setShelfWidth:prevShelfWidthBeforeDoubleClick];