diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index ee7824a5f..983b6e14e 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -116,6 +116,7 @@ A261A8260C6A0D68003BAFDA /* Error.png in Resources */ = {isa = PBXBuildFile; fileRef = A261A8250C6A0D68003BAFDA /* Error.png */; }; A261F1DC0A69A1610002815A /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A261F1DB0A69A1610002815A /* Growl.framework */; }; A261F1E40A69A1B10002815A /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = A261F1DB0A69A1610002815A /* Growl.framework */; }; + A26397550D0F714300D36DF2 /* ActionPopUpButton.m in Sources */ = {isa = PBXBuildFile; fileRef = A26397540D0F714300D36DF2 /* ActionPopUpButton.m */; }; A26E75880CB6AA7500226674 /* InfoOptions.png in Resources */ = {isa = PBXBuildFile; fileRef = A26E75870CB6AA7500226674 /* InfoOptions.png */; }; A26E75960CB6AB4800226674 /* InfoGeneral.png in Resources */ = {isa = PBXBuildFile; fileRef = A26E75950CB6AB4800226674 /* InfoGeneral.png */; }; A2710E770A86796000CE4F7D /* PrefsWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = A2710E750A86796000CE4F7D /* PrefsWindow.m */; }; @@ -483,6 +484,8 @@ A25FCDDE0A37695F002BCBBE /* ResumeSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeSelected.png; path = macosx/Images/ResumeSelected.png; sourceTree = ""; }; A261A8250C6A0D68003BAFDA /* Error.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Error.png; path = macosx/Images/Error.png; sourceTree = ""; }; A261F1DB0A69A1610002815A /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = macosx/Growl.framework; sourceTree = ""; }; + A26397530D0F714300D36DF2 /* ActionPopUpButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ActionPopUpButton.h; path = macosx/ActionPopUpButton.h; sourceTree = ""; }; + A26397540D0F714300D36DF2 /* ActionPopUpButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ActionPopUpButton.m; path = macosx/ActionPopUpButton.m; sourceTree = ""; }; A26E75870CB6AA7500226674 /* InfoOptions.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = InfoOptions.png; path = macosx/Images/InfoOptions.png; sourceTree = ""; }; A26E75950CB6AB4800226674 /* InfoGeneral.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = InfoGeneral.png; path = macosx/Images/InfoGeneral.png; sourceTree = ""; }; A2710E740A86796000CE4F7D /* PrefsWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PrefsWindow.h; path = macosx/PrefsWindow.h; sourceTree = ""; }; @@ -776,6 +779,8 @@ 4D364D9F091FBB2C00377D12 /* TorrentTableView.m */, 4DCCBB3D09C3D71100D3CABF /* TorrentCell.h */, 4DCCBB3C09C3D71100D3CABF /* TorrentCell.m */, + A26397530D0F714300D36DF2 /* ActionPopUpButton.h */, + A26397540D0F714300D36DF2 /* ActionPopUpButton.m */, A2BF078E0B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.h */, A2BF078F0B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.m */, A21F5C010AF26DD5008CE5CE /* ActionMenuSpeedToDisplayLimitTransformer.h */, @@ -1726,6 +1731,7 @@ A20BFFB70D091CC700CE5D2B /* ToolbarSegmentedCell.m in Sources */, 3C7A11950D0B2EE300B5701F /* getgateway.c in Sources */, 3C7A11960D0B2EE300B5701F /* natpmp.c in Sources */, + A26397550D0F714300D36DF2 /* ActionPopUpButton.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/macosx/ActionPopUpButton.h b/macosx/ActionPopUpButton.h new file mode 100644 index 000000000..360e105a9 --- /dev/null +++ b/macosx/ActionPopUpButton.h @@ -0,0 +1,31 @@ +/****************************************************************************** + * $Id$ + * + * Copyright (c) 2007 Transmission authors and contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + *****************************************************************************/ + +#import + +@interface ActionPopUpButton : NSPopUpButton +{ + NSImage * fImage; +} +@end diff --git a/macosx/ActionPopUpButton.m b/macosx/ActionPopUpButton.m new file mode 100644 index 000000000..1370dc2b8 --- /dev/null +++ b/macosx/ActionPopUpButton.m @@ -0,0 +1,68 @@ +/****************************************************************************** + * $Id$ + * + * Copyright (c) 2007 Transmission authors and contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + *****************************************************************************/ + +#import "ActionPopUpButton.h" +#import "NSApplicationAdditions.h" + +@implementation ActionPopUpButton + +//only needed on tiger + +- (id) initWithCoder: (NSCoder *) coder +{ + if ((self = [super initWithCoder: coder])) + { + if (![NSApp isOnLeopardOrBetter]) + { + fImage = [NSImage imageNamed: @"ActionGear.png"]; + [fImage setFlipped: YES]; + } + } + return self; +} + +- (void) awakeFromNib +{ + if (![NSApp isOnLeopardOrBetter]) + { + [(NSPopUpButtonCell *)[self cell] setArrowPosition: NSPopUpNoArrow]; + [[[self menu] itemAtIndex: 0] setImage: nil]; + } +} + +- (void) drawRect: (NSRect) rect +{ + [super drawRect: rect]; + + if ([NSApp isOnLeopardOrBetter]) + return; + + NSSize imageSize = [fImage size]; + NSRect imageRect = NSMakeRect(rect.origin.x + (rect.size.width - imageSize.width) * 0.5, + rect.origin.y + (rect.size.height - imageSize.height) * 0.5, imageSize.width, imageSize.height); + + [fImage drawInRect: imageRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0]; +} + +@end diff --git a/macosx/English.lproj/MainMenu.nib/classes.nib b/macosx/English.lproj/MainMenu.nib/classes.nib index 3b9950231..e850e4fdc 100644 --- a/macosx/English.lproj/MainMenu.nib/classes.nib +++ b/macosx/English.lproj/MainMenu.nib/classes.nib @@ -240,6 +240,14 @@ SUPERCLASS NSObject + + CLASS + FilterButton + LANGUAGE + ObjC + SUPERCLASS + NSButton + ACTIONS @@ -280,11 +288,11 @@ CLASS - FilterButton + ActionPopUpButton LANGUAGE ObjC SUPERCLASS - NSButton + NSPopUpButton CLASS diff --git a/macosx/English.lproj/MainMenu.nib/info.nib b/macosx/English.lproj/MainMenu.nib/info.nib index ea20e7542..c0c699ea6 100644 --- a/macosx/English.lproj/MainMenu.nib/info.nib +++ b/macosx/English.lproj/MainMenu.nib/info.nib @@ -10,7 +10,8 @@ 5 IBOpenObjects - 1480 + 1041 + 2351 IBSystem Version 9B18 diff --git a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib index 1f871783d..d12a993a1 100644 Binary files a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib and b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/macosx/Images/ActionGear.png b/macosx/Images/ActionGear.png index 36a9fbb31..5eca49340 100644 Binary files a/macosx/Images/ActionGear.png and b/macosx/Images/ActionGear.png differ