summaryrefslogtreecommitdiff
path: root/frontends/cocoa/PSMTabBarControl/PSMProgressIndicator.m
blob: 4532f31beef1bb127e3bd1a17853ad37f9ddd002 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
//  PSMProgressIndicator.m
//  PSMTabBarControl
//
//  Created by John Pannell on 2/23/06.
//  Copyright 2006 Positive Spin Media. All rights reserved.
//

#import "PSMProgressIndicator.h"
#import "PSMTabBarControl.h"

@interface PSMTabBarControl (PSMProgressIndicatorExtensions)

- (void)update;

@end

@implementation PSMProgressIndicator

- (id)initWithFrame:(NSRect)frameRect
{
    if ((self = [super initWithFrame:frameRect]) == nil)
        return nil;
    [self setControlSize:NSControlSizeSmall];
    return self;
}

// overrides to make tab bar control re-layout things if status changes
- (void)setHidden:(BOOL)flag
{
    [super setHidden:flag];
    [(PSMTabBarControl *)[self superview] update];
}

- (void)stopAnimation:(id)sender
{
    [NSObject cancelPreviousPerformRequestsWithTarget:self
                                             selector:@selector(startAnimation:)
                                               object:nil];
    [super stopAnimation:sender];
}

@end