1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-07 23:14:41 +00:00

show the "quitting" dock overlay on 10.4

This commit is contained in:
Mitchell Livingston 2007-12-30 20:28:36 +00:00
parent 257d150d98
commit 50abad0d1f
2 changed files with 25 additions and 1 deletions

View file

@ -26,10 +26,12 @@
#import "BadgeView.h"
#import "NSApplicationAdditions.h"
#import "NSStringAdditions.h"
#import "NSBezierPathAdditions.h"
#define COMPLETED_BOTTOM_PADDING 5.0
#define SPEED_BOTTOM_PADDING 2.0
#define SPEED_BETWEEN_PADDING 2.0
#define BADGE_HEIGHT 30.0
@interface Badger (Private)
@ -69,6 +71,8 @@
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
[NSApp setApplicationIconImage: nil];
[fDockIcon release];
[fAttributes release];
@ -236,7 +240,25 @@
fSpeedBadge = NO;
fCompleted = 0;
fCompletedBadged = 0;
[NSApp setApplicationIconImage: nil];
NSImage * quitIcon = [[NSImage imageNamed: @"NSApplicationIcon"] copy];
NSRect rect = NSZeroRect;
rect.size = [quitIcon size];
NSRect badgeRect = NSMakeRect(0.0, (rect.size.height - BADGE_HEIGHT) * 0.5, rect.size.width, BADGE_HEIGHT);
NSBezierPath * bp = [NSBezierPath bezierPathWithRoundedRect: badgeRect radius: 15.0];
[quitIcon lockFocus];
[[NSColor colorWithCalibratedWhite: 0.0 alpha: 0.75] set];
[bp fill];
[self badgeString: NSLocalizedString(@"Quitting", "Dock Badger -> quit message") forRect: badgeRect];
[quitIcon unlockFocus];
[NSApp setApplicationIconImage: quitIcon];
[quitIcon release];
}
}

View file

@ -595,6 +595,8 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
//complete cleanup
tr_close(fLib);
[fBadger release]; //clears dock icon on 10.4
}
- (void) handleOpenContentsEvent: (NSAppleEventDescriptor *) event replyEvent: (NSAppleEventDescriptor *) replyEvent