diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index 505e9f8e9..0d6a07cf9 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -111,7 +111,6 @@ A24600510A6DCE6600D19088 /* SpeedLimitButtonBlue.png in Resources */ = {isa = PBXBuildFile; fileRef = A246004F0A6DCE6600D19088 /* SpeedLimitButtonBlue.png */; }; A24600520A6DCE6600D19088 /* SpeedLimitButtonGraphite.png in Resources */ = {isa = PBXBuildFile; fileRef = A24600500A6DCE6600D19088 /* SpeedLimitButtonGraphite.png */; }; A24999230B49F1B5001EADA3 /* ActionPopUpButton.m in Sources */ = {isa = PBXBuildFile; fileRef = A24999210B49F1B5001EADA3 /* ActionPopUpButton.m */; }; - A24999440B49F5AD001EADA3 /* ActionPopUpButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A24999420B49F5AD001EADA3 /* ActionPopUpButtonCell.m */; }; A24F19080A3A790800C9C145 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A24F19070A3A790800C9C145 /* Sparkle.framework */; }; A24F19210A3A796800C9C145 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = A24F19070A3A790800C9C145 /* Sparkle.framework */; }; A253F6F30A698970008EE24F /* FilterBarBackground.png in Resources */ = {isa = PBXBuildFile; fileRef = A253F6F20A698970008EE24F /* FilterBarBackground.png */; }; @@ -313,8 +312,6 @@ A24600500A6DCE6600D19088 /* SpeedLimitButtonGraphite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = SpeedLimitButtonGraphite.png; path = macosx/Images/SpeedLimitButtonGraphite.png; sourceTree = ""; }; A24999200B49F1B5001EADA3 /* ActionPopUpButton.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ActionPopUpButton.h; path = macosx/ActionPopUpButton.h; sourceTree = ""; }; A24999210B49F1B5001EADA3 /* ActionPopUpButton.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = ActionPopUpButton.m; path = macosx/ActionPopUpButton.m; sourceTree = ""; }; - A24999420B49F5AD001EADA3 /* ActionPopUpButtonCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = ActionPopUpButtonCell.m; path = macosx/ActionPopUpButtonCell.m; sourceTree = ""; }; - A24999430B49F5AD001EADA3 /* ActionPopUpButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ActionPopUpButtonCell.h; path = macosx/ActionPopUpButtonCell.h; sourceTree = ""; }; A24F19070A3A790800C9C145 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = macosx/Sparkle.framework; sourceTree = ""; }; A253F6F20A698970008EE24F /* FilterBarBackground.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FilterBarBackground.png; path = macosx/Images/FilterBarBackground.png; sourceTree = ""; }; A253F7080A6990EB008EE24F /* FilterButtonOverMain.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FilterButtonOverMain.png; path = macosx/Images/FilterButtonOverMain.png; sourceTree = ""; }; @@ -467,8 +464,6 @@ A2AA579B0ADFCAB400CA59F6 /* PiecesImageView.m */, A24999200B49F1B5001EADA3 /* ActionPopUpButton.h */, A24999210B49F1B5001EADA3 /* ActionPopUpButton.m */, - A24999420B49F5AD001EADA3 /* ActionPopUpButtonCell.m */, - A24999430B49F5AD001EADA3 /* ActionPopUpButtonCell.h */, ); name = Sources; sourceTree = ""; @@ -934,7 +929,6 @@ A25E74660AF5097D006F11AE /* ExpandedPathToIconTransformer.m in Sources */, A2BF07910B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.m in Sources */, A24999230B49F1B5001EADA3 /* ActionPopUpButton.m in Sources */, - A24999440B49F5AD001EADA3 /* ActionPopUpButtonCell.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/macosx/ActionPopUpButton.h b/macosx/ActionPopUpButton.h index 54f10180a..635470c7f 100644 --- a/macosx/ActionPopUpButton.h +++ b/macosx/ActionPopUpButton.h @@ -4,5 +4,6 @@ @interface ActionPopUpButton : NSPopUpButton { + NSImage * fImage, * fImagePressed; } @end diff --git a/macosx/ActionPopUpButton.m b/macosx/ActionPopUpButton.m index b50e5fc49..b5864b2a2 100644 --- a/macosx/ActionPopUpButton.m +++ b/macosx/ActionPopUpButton.m @@ -1,15 +1,24 @@ #import "ActionPopUpButton.h" -#import "ActionPopUpButtonCell.h" @implementation ActionPopUpButton - (id) initWithCoder: (NSCoder *) coder { - if (self = [super initWithCoder: coder]) + if ((self = [super initWithCoder: coder])) { - [self setCell: [[ActionPopUpButtonCell alloc] initTextCell: @"" pullsDown: YES]]; + fImage = [NSImage imageNamed: @"ActionButton.png"]; + [fImage setFlipped: YES]; + fImagePressed = [NSImage imageNamed: @"ActionButtonPressed.png"]; + [fImagePressed setFlipped: YES]; } return self; } +- (void) drawRect: (NSRect) rect +{ + NSImage * image = [[self cell] isHighlighted] ? fImagePressed : fImage; + [image drawInRect: rect fromRect: NSMakeRect(0.0, 0.0, [image size].width, [image size].height) + operation: NSCompositeSourceOver fraction: 1.0]; +} + @end diff --git a/macosx/ActionPopUpButtonCell.h b/macosx/ActionPopUpButtonCell.h deleted file mode 100644 index edba57f5d..000000000 --- a/macosx/ActionPopUpButtonCell.h +++ /dev/null @@ -1,9 +0,0 @@ -/* ActionPopUpButton */ - -#import - -@interface ActionPopUpButtonCell : NSPopUpButtonCell -{ - NSImage * fImage, * fImagePressed; -} -@end diff --git a/macosx/ActionPopUpButtonCell.m b/macosx/ActionPopUpButtonCell.m deleted file mode 100644 index e7db43a3b..000000000 --- a/macosx/ActionPopUpButtonCell.m +++ /dev/null @@ -1,24 +0,0 @@ -#import "ActionPopUpButtonCell.h" - -@implementation ActionPopUpButtonCell - -- (id) initTextCell: (NSString *) string pullsDown: (BOOL) pullDown -{ - if ((self = [super initTextCell: string pullsDown: YES])) - { - fImage = [NSImage imageNamed: @"ActionButton.png"]; - [fImage setFlipped: YES]; - fImagePressed = [NSImage imageNamed: @"ActionButtonPressed.png"]; - [fImagePressed setFlipped: YES]; - } - return self; -} - -- (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView -{ - NSImage * image = [self isHighlighted] ? fImagePressed : fImage; - [image drawInRect: cellFrame fromRect: NSMakeRect(0.0, 0.0, [image size].width, [image size].height) - operation: NSCompositeSourceOver fraction: 1.0]; -} - -@end