Adium

Changeset 23278

Show
Ignore:
Timestamp:
05/02/2008 07:56:57 PM (7 months ago)
Author:
zacw
Message:

Only allow AIListGroups to be expanded in the contact list (bad meta contacts!). Only allow clickthrough collapsing/expanding when "triangle" clicking.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Frameworks/Adium Framework/Source/AIListOutlineView.m

    r23264 r23278  
    487487         
    488488        // Let super handle it if it's not a group, or the command key is down (dealing with selection) 
    489         if (![[self window] isKeyWindow] || ![item isKindOfClass:[AIListGroup class]] || [NSEvent cmdKey]) { 
     489        // Allow clickthroughs for triangle disclosure only. 
     490        if (![item isKindOfClass:[AIListGroup class]] || 
     491                [NSEvent cmdKey] || 
     492                (![[self window] isKeyWindow] && (viewPoint.x > [self frameOfCellAtColumn:0 row:row].size.height))) { 
     493                        //XXX - This is kind of a hack.  We need to check < WidthOfDisclosureTriangle, and are using the fact that 
     494                        //      the disclosure width is about the same as the height of the row to fudge it. -ai) { 
    490495                [super mouseDown:theEvent]; 
    491496                return; 
  • trunk/Frameworks/AIUtilities Framework/Source/AIVariableHeightOutlineView.m

    r23262 r23278  
    7474} 
    7575 
    76 //Handle mouseDown events to toggle expandable items when they are clicked 
    77 - (void)mouseDown:(NSEvent *)theEvent 
    78 { 
    79         NSPoint viewPoint = [self convertPoint:[theEvent locationInWindow] fromView:nil]; 
    80         int             row = [self rowAtPoint:viewPoint]; 
    81         id              item = [self itemAtRow:row]; 
    82          
    83         //Expand/Collapse groups on mouse DOWN instead of mouse up (Makes it feel a ton faster) 
    84         if ((item) && 
    85                 ([self isExpandable:item]) && 
    86                 (viewPoint.x < [self frameOfCellAtColumn:0 row:row].size.height)) { 
    87                 //XXX - This is kind of a hack.  We need to check < WidthOfDisclosureTriangle, and are using the fact that 
    88                 //      the disclosure width is about the same as the height of the row to fudge it. -ai 
    89                  
    90                 if ([self isItemExpanded:item]) { 
    91                         [self collapseItem:item]; 
    92                 } else { 
    93                         [self expandItem:item]; 
    94                 } 
    95         } else { 
    96                 [super mouseDown:theEvent]; 
    97         } 
    98 } 
    9976//Row height cache ----------------------------------------------------------------------------------------------------- 
    10077#pragma mark Row height cache