2 // AIBorderlessListController.m
5 // Created by Evan Schoenberg on 1/8/06.
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])) {
23 [self contactOrderChanged:nil];
29 - (void)configureViewsAndTooltips
31 [super configureViewsAndTooltips];
33 [self contactOrderChanged:nil];
36 * @brief When the contact order changes, check to ensure we have 1 or more visible rows
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.
41 - (void)contactOrderChanged:(NSNotification *)notification
43 [super contactOrderChanged:notification];
45 int numberOfRows = [contactListView numberOfRows];
47 if (numberOfRows && emptyListHiding) {
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];