Changeset 4342


Ignore:
Timestamp:
Dec 26, 2007, 4:28:13 PM (14 years ago)
Author:
livings124
Message:

experiment with badging the dock with "Quitting"

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/BadgeView.h

    r4073 r4342  
    3333   
    3434    BOOL fQuitting;
     35    NSImage * fQuitBadge;
    3536}
    3637
  • trunk/macosx/BadgeView.m

    r4080 r4342  
    2929#define BETWEEN_PADDING 2.0
    3030
     31#define BADGE_HEIGHT 30.0
     32
    3133@interface BadgeView (Private)
    3234
     
    5557{
    5658    [fAttributes release];
     59    [fQuitBadge release];
    5760    [super dealloc];
    5861}
     
    6467    if (fQuitting)
    6568    {
    66         #warning make better
    67         //[self badge: [NSImage imageNamed: @"UploadBadge"] string: @"Quitting" atHeight: 0.0];
     69        if (!fQuitBadge)
     70        {
     71            NSRect badgeRect = NSMakeRect(0.0, 0.0, rect.size.width, BADGE_HEIGHT);
     72            NSBezierPath * bp = [NSBezierPath bezierPathWithRoundedRect: badgeRect xRadius: 15.0 yRadius: 15.0];
     73           
     74            fQuitBadge = [[NSImage alloc] initWithSize: badgeRect.size];
     75            [fQuitBadge lockFocus];
     76           
     77            [[NSColor colorWithCalibratedWhite: 0.0 alpha: 0.75] set];
     78            [bp fill];
     79           
     80            [fQuitBadge unlockFocus];
     81        }
     82       
     83        [self badge: fQuitBadge string: NSLocalizedString(@"Quitting", "Dock Badger -> quit message")
     84                atHeight: (rect.size.height - BADGE_HEIGHT) * 0.5];
    6885        return;
    6986    }
Note: See TracChangeset for help on using the changeset viewer.