Adium

Changeset 22944

Show
Ignore:
Timestamp:
03/17/2008 12:04:36 AM (8 months ago)
Author:
zacw
Message:

Fix setting the first responder and keying the window before the animation is finished--mostly my fault. Now to find the overly annoying NSBeep() when the search field is closed. Fixes #9476.

Files:

Legend:

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

    r22943 r22944  
    800800        [[self window] makeFirstResponder:searchField]; 
    801801        [[[self window] fieldEditor:YES forObject:searchField] keyDown:theEvent]; 
    802          
    803802} 
    804803 
     
    812811        if (filterBarIsVisible || filterBarIsAnimating) 
    813812                return; 
     813         
     814        filterBarIsAnimating = YES; 
    814815         
    815816        NSSize filterBarSize = [filterBarView bounds].size; 
     
    848849        [[[self window]contentView]addSubview:filterBarView]; 
    849850         
    850         [[self window]makeFirstResponder:searchField];  
    851          
    852851        NSDictionary *filterBarAnimationDictionary = [NSDictionary dictionaryWithObjectsAndKeys:filterBarView, NSViewAnimationTargetKey, 
    853852                                                                                                  [NSValue valueWithRect:endingFilterBarFrame], NSViewAnimationEndFrameKey, nil]; 
     
    856855         
    857856        showFilterBarAnimation = [[NSViewAnimation alloc]initWithViewAnimations:[NSArray arrayWithObjects:viewToResizeAnimationDictionary,filterBarAnimationDictionary,nil]]; 
    858         [showFilterBarAnimation setDuration:flag ? 0.25f : 0.0f]; 
     857        [showFilterBarAnimation setDuration:(flag ? 0.25f : 0.0f)]; 
    859858        [showFilterBarAnimation setAnimationBlockingMode:NSAnimationBlocking]; 
    860859        [showFilterBarAnimation setDelegate:self]; 
    861         filterBarIsAnimating = YES; 
    862860 
    863861        //disable vertical autoresizing just while the animation is running 
     
    872870        [contactListView setEnableAnimation:NO]; 
    873871         
    874         [filterBarView setNextResponder:contactListView]; 
    875         [[self window] makeKeyAndOrderFront:nil]; 
    876          
    877872        filterBarIsVisible = YES; 
    878873} 
     
    887882        if (!filterBarIsVisible || filterBarIsAnimating) 
    888883                return; 
     884         
     885        filterBarIsAnimating = YES; 
    889886         
    890887        //clear the search and show all contacts 
     
    922919         
    923920        hideFilterBarAnimation = [[NSViewAnimation alloc]initWithViewAnimations:[NSArray arrayWithObjects:viewToResizeAnimationDictionary,filterBarAnimationDictionary,nil]]; 
    924         [hideFilterBarAnimation setDuration:0.25]; 
     921        [hideFilterBarAnimation setDuration:(flag ? 0.25f : 0.0f)]; 
    925922        [hideFilterBarAnimation setAnimationBlockingMode:NSAnimationBlocking]; 
    926923        filterBarIsVisible = NO; 
    927924        [hideFilterBarAnimation setDelegate:self]; 
    928         filterBarIsAnimating = YES; 
    929925 
    930926        //disable vertical autoresizing just while the animation is running 
     
    934930        [contactListController setAutoresizeHorizontally:[[[adium preferenceController] preferenceForKey:KEY_LIST_LAYOUT_HORIZONTAL_AUTOSIZE group:PREF_GROUP_APPEARANCE] boolValue]]; 
    935931        [contactListView setEnableAnimation:YES]; 
    936          
    937         [[self window] makeFirstResponder:contactListView]; 
    938932} 
    939933 
     
    947941        if (animation == hideFilterBarAnimation) { 
    948942                [filterBarView removeFromSuperview]; 
     943                [[self window] makeFirstResponder:contactListView]; 
     944        } else { 
     945                [[self window] makeFirstResponder:searchField];  
     946                [filterBarView setNextResponder:contactListView]; 
     947                [[self window] makeKeyAndOrderFront:nil]; 
    949948        } 
    950949