Added `-[NSArray validateAsPropertyList]` and `-[NSDictionary validateAsPropertyList...
[adiumx.git] / Source / AIBorderlessListController.m
blob6a047302634bbb474ca2630089c2295dd6988850
1 //
2 //  AIBorderlessListController.m
3 //  Adium
4 //
5 //  Created by Evan Schoenberg on 1/8/06.
6 //
8 #import "AIBorderlessListController.h"
9 #import "AIListOutlineView.h"
11 @implementation AIBorderlessListController
13 - (id)initWithContactList:(AIListObject<AIContainingObject> *)aContactList
14                         inOutlineView:(AIListOutlineView *)inContactListView
15                          inScrollView:(AIAutoScrollView *)inScrollView_contactList
16                                  delegate:(id<AIListControllerDelegate>)inDelegate
18         if ((self = [super initWithContactList:aContactList
19                                                          inOutlineView:inContactListView
20                                                           inScrollView:inScrollView_contactList
21                                                                   delegate:inDelegate])) {
22                 emptyListHiding = NO;
23                 [self contactOrderChanged:nil];
24         }
25         
26         return self;
29 - (void)configureViewsAndTooltips
31         [super configureViewsAndTooltips];
32         
33         [self contactOrderChanged:nil];
35 /*!
36  * @brief When the contact order changes, check to ensure we have 1 or more visible rows
37  *
38  * If we have no rows visible, hide the contact list, redisplaying it when rows are visible again.
39  * orderOut: doesn't appear to work for borderless windows, so we just go to an alpha value of 0.
40  */
41 - (void)contactOrderChanged:(NSNotification *)notification
43         [super contactOrderChanged:notification];
45         int numberOfRows = [contactListView numberOfRows];
47         if (numberOfRows && emptyListHiding) {  
48                 emptyListHiding = NO;           
49                 [[contactListView window] setAlphaValue:previousAlpha];
50                 [[contactListView window] orderFront:nil];
52         } else if (!numberOfRows && !emptyListHiding) { 
53                 emptyListHiding = YES;
54                 previousAlpha = [[contactListView window] alphaValue];
55                 [[contactListView window] setAlphaValue:0.0];
56         }
59 @end