diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index 8579d0ce3..7cc233da3 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -99,6 +99,7 @@ A24621410C769D0900088E81 /* trevent.h in Headers */ = {isa = PBXBuildFile; fileRef = A24621350C769CF400088E81 /* trevent.h */; }; A24621420C769D0900088E81 /* trevent.c in Sources */ = {isa = PBXBuildFile; fileRef = A24621360C769CF400088E81 /* trevent.c */; }; A24872B60C9B6BB9000F5B92 /* Advanced.png in Resources */ = {isa = PBXBuildFile; fileRef = A24872B50C9B6BB9000F5B92 /* Advanced.png */; }; + A24B65600D3F30870079EA4D /* QuitBadge.png in Resources */ = {isa = PBXBuildFile; fileRef = A24B655F0D3F30870079EA4D /* QuitBadge.png */; }; A24D2A640C0A624600A0ED9F /* IPCController.m in Sources */ = {isa = PBXBuildFile; fileRef = A24D2A620C0A624600A0ED9F /* IPCController.m */; }; A24F19080A3A790800C9C145 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A24F19070A3A790800C9C145 /* Sparkle.framework */; }; A24F19210A3A796800C9C145 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = A24F19070A3A790800C9C145 /* Sparkle.framework */; }; @@ -474,6 +475,7 @@ A24621350C769CF400088E81 /* trevent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = trevent.h; path = libtransmission/trevent.h; sourceTree = ""; }; A24621360C769CF400088E81 /* trevent.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = trevent.c; path = libtransmission/trevent.c; sourceTree = ""; }; A24872B50C9B6BB9000F5B92 /* Advanced.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Advanced.png; path = macosx/Images/Advanced.png; sourceTree = ""; }; + A24B655F0D3F30870079EA4D /* QuitBadge.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = QuitBadge.png; path = macosx/Images/QuitBadge.png; sourceTree = ""; }; A24D2A610C0A624600A0ED9F /* IPCController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = IPCController.h; path = macosx/IPCController.h; sourceTree = ""; }; A24D2A620C0A624600A0ED9F /* IPCController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = IPCController.m; path = macosx/IPCController.m; sourceTree = ""; }; A24D2A770C0A65C400A0ED9F /* ipcparse.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ipcparse.c; path = libtransmission/ipcparse.c; sourceTree = ""; }; @@ -960,6 +962,7 @@ 4DE5CCA80980739100BE280E /* Badge.png */, 4DDFDD20099A5D8E00189D81 /* DownloadBadge.png */, 4DDFDD21099A5D8E00189D81 /* UploadBadge.png */, + A24B655F0D3F30870079EA4D /* QuitBadge.png */, 4DE5CCB80981D27700BE280E /* ResumeAll.png */, 4DE5CCB90981D27700BE280E /* PauseAll.png */, A25FCDDD0A37695F002BCBBE /* PauseSelected.png */, @@ -1643,6 +1646,7 @@ A2623B410D3DC5930045D19A /* ResumeHover.png in Resources */, A2623B420D3DC5930045D19A /* PauseHover.png in Resources */, A2623B4E0D3DC6DF0045D19A /* ActionHover.png in Resources */, + A24B65600D3F30870079EA4D /* QuitBadge.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/macosx/BadgeView.h b/macosx/BadgeView.h index 2b28f4025..4dc8c6efc 100644 --- a/macosx/BadgeView.h +++ b/macosx/BadgeView.h @@ -32,7 +32,6 @@ NSDictionary * fAttributes; BOOL fQuitting; - NSImage * fQuitBadge; } - (id) initWithFrame: (NSRect) frame lib: (tr_handle *) lib; diff --git a/macosx/BadgeView.m b/macosx/BadgeView.m index a3fdaa1cf..38efc5058 100644 --- a/macosx/BadgeView.m +++ b/macosx/BadgeView.m @@ -25,7 +25,6 @@ #import "BadgeView.h" #import "NSStringAdditions.h" -#define BADGE_HEIGHT 30.0 #define BETWEEN_PADDING 2.0 @interface BadgeView (Private) @@ -54,7 +53,6 @@ - (void) dealloc { [fAttributes release]; - [fQuitBadge release]; [super dealloc]; } @@ -64,22 +62,8 @@ if (fQuitting) { - if (!fQuitBadge) - { - NSRect badgeRect = NSMakeRect(0.0, 0.0, rect.size.width, BADGE_HEIGHT); - NSBezierPath * bp = [NSBezierPath bezierPathWithRoundedRect: badgeRect xRadius: 15.0 yRadius: 15.0]; - - fQuitBadge = [[NSImage alloc] initWithSize: badgeRect.size]; - [fQuitBadge lockFocus]; - - [[NSColor colorWithCalibratedWhite: 0.0 alpha: 0.75] set]; - [bp fill]; - - [fQuitBadge unlockFocus]; - } - - [self badge: fQuitBadge string: NSLocalizedString(@"Quitting", "Dock Badger -> quit message") - atHeight: (rect.size.height - BADGE_HEIGHT) * 0.5]; + [self badge: [NSImage imageNamed: @"QuitBadge.png"] string: NSLocalizedString(@"Quitting", "Dock Badger -> quit") + atHeight: (rect.size.height - [[NSImage imageNamed: @"UploadBadge"] size].height) * 0.5]; return; } @@ -91,13 +75,16 @@ tr_torrentRates(fLib, &downloadRate, &uploadRate); BOOL upload = checkUpload && uploadRate >= 0.1; + upload = YES; if (upload) - [self badge: [NSImage imageNamed: @"UploadBadge"] string: [NSString stringForSpeedAbbrev: uploadRate] atHeight: 0.0]; - if (checkDownload && downloadRate >= 0.1) + [self badge: [NSImage imageNamed: @"UploadBadge.png"] string: [NSString stringForSpeedAbbrev: uploadRate] atHeight: 0.0]; + //if (checkDownload && downloadRate >= 0.1) + if (YES) { //download rate above upload rate - float bottom = upload ? [[NSImage imageNamed: @"UploadBadge"] size].height + BETWEEN_PADDING : 0.0; - [self badge: [NSImage imageNamed: @"DownloadBadge"] string: [NSString stringForSpeedAbbrev: downloadRate] atHeight: bottom]; + float bottom = upload ? [[NSImage imageNamed: @"UploadBadge.png"] size].height + BETWEEN_PADDING : 0.0; + [self badge: [NSImage imageNamed: @"DownloadBadge.png"] string: [NSString stringForSpeedAbbrev: downloadRate] + atHeight: bottom]; } } } diff --git a/macosx/Badger.m b/macosx/Badger.m index 38d4be26e..2689ab717 100644 --- a/macosx/Badger.m +++ b/macosx/Badger.m @@ -157,7 +157,7 @@ dockIcon = [fDockIcon copy]; NSRect badgeRect; - badgeRect.size = [[NSImage imageNamed: @"UploadBadge"] size]; + badgeRect.size = [[NSImage imageNamed: @"UploadBadge.png"] size]; badgeRect.origin = NSZeroPoint; //ignore shadow of badge when placing string @@ -170,7 +170,7 @@ if (uploadRateString) { //place badge and text - [[NSImage imageNamed: @"UploadBadge"] compositeToPoint: badgeRect.origin operation: NSCompositeSourceOver]; + [[NSImage imageNamed: @"UploadBadge.png"] compositeToPoint: badgeRect.origin operation: NSCompositeSourceOver]; [self badgeString: uploadRateString forRect: stringRect]; } @@ -185,7 +185,7 @@ } //place badge and text - [[NSImage imageNamed: @"DownloadBadge"] compositeToPoint: badgeRect.origin operation: NSCompositeSourceOver]; + [[NSImage imageNamed: @"DownloadBadge.png"] compositeToPoint: badgeRect.origin operation: NSCompositeSourceOver]; [self badgeString: downloadRateString forRect: stringRect]; } @@ -246,13 +246,10 @@ 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]; + [[NSImage imageNamed: @"QuitBadge.png"] compositeToPoint: badgeRect.origin operation: NSCompositeSourceOver]; [self badgeString: NSLocalizedString(@"Quitting", "Dock Badger -> quit message") forRect: badgeRect]; [quitIcon unlockFocus]; diff --git a/macosx/Images/DownloadBadge.png b/macosx/Images/DownloadBadge.png index ee80adcff..968b16088 100644 Binary files a/macosx/Images/DownloadBadge.png and b/macosx/Images/DownloadBadge.png differ diff --git a/macosx/Images/UploadBadge.png b/macosx/Images/UploadBadge.png index 42a222917..b5be5038e 100644 Binary files a/macosx/Images/UploadBadge.png and b/macosx/Images/UploadBadge.png differ