Skip to content

Commit 0e28fe1

Browse files
committed
Add a custom NSActionTemplate image derived from the Cocotron project, with thanks to Math Campbell (www.mathcampbell.co.uk), for pre 10.5 systems.
1 parent 909dbed commit 0e28fe1

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

ClickToFlash.xcodeproj/project.pbxproj

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
/* Begin PBXBuildFile section */
3737
0038DE240FC0CCF0007B54E9 /* MATrackingArea.m in Sources */ = {isa = PBXBuildFile; fileRef = 0038DE230FC0CCF0007B54E9 /* MATrackingArea.m */; };
3838
0038DE320FC0CE7B007B54E9 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0038DE310FC0CE7B007B54E9 /* Carbon.framework */; };
39+
00FBE92F0FCD68CE00BC0995 /* NSActionTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 00FBE92E0FCD68CE00BC0995 /* NSActionTemplate.png */; };
3940
072189BE0F30D9C3008C8944 /* ContextualMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 072189BA0F30D9C3008C8944 /* ContextualMenu.xib */; };
4041
072189BF0F30D9C3008C8944 /* WhitelistPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = 072189BC0F30D9C3008C8944 /* WhitelistPanel.xib */; };
4142
55EB70480E04A8850016593D /* Plugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 55EB703D0E04A84F0016593D /* Plugin.m */; };
@@ -129,6 +130,7 @@
129130
0038DE220FC0CCF0007B54E9 /* MATrackingArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MATrackingArea.h; sourceTree = "<group>"; };
130131
0038DE230FC0CCF0007B54E9 /* MATrackingArea.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MATrackingArea.m; sourceTree = "<group>"; };
131132
0038DE310FC0CE7B007B54E9 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
133+
00FBE92E0FCD68CE00BC0995 /* NSActionTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = NSActionTemplate.png; sourceTree = "<group>"; };
132134
072189BB0F30D9C3008C8944 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Plugin/English.lproj/ContextualMenu.xib; sourceTree = "<group>"; };
133135
072189BD0F30D9C3008C8944 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Plugin/English.lproj/WhitelistPanel.xib; sourceTree = "<group>"; };
134136
55EB703C0E04A84F0016593D /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = Plugin/Plugin.h; sourceTree = "<group>"; };
@@ -239,6 +241,7 @@
239241
072189BC0F30D9C3008C8944 /* WhitelistPanel.xib */,
240242
D9FFA7650F3941C1008A8708 /* ClickToFlash_Prefix.pch */,
241243
A494CC2B0F9F2446007D5EEB /* ctf.icns */,
244+
00FBE92E0FCD68CE00BC0995 /* NSActionTemplate.png */,
242245
D9566C2B0F37EA0800358646 /* deSIFR Resources */,
243246
79E2EB910F86AAD3005CF170 /* SparkleManager.h */,
244247
79E2EB920F86AAD3005CF170 /* SparkleManager.m */,
@@ -397,6 +400,7 @@
397400
072189BF0F30D9C3008C8944 /* WhitelistPanel.xib in Resources */,
398401
6953E43C0F3EDEB50014ECF7 /* MenubarMenu.xib in Resources */,
399402
A494CC2C0F9F2446007D5EEB /* ctf.icns in Resources */,
403+
00FBE92F0FCD68CE00BC0995 /* NSActionTemplate.png in Resources */,
400404
);
401405
runOnlyForDeploymentPostprocessing = 0;
402406
};

NSActionTemplate.png

3.71 KB
Loading

Plugin/Plugin.m

+6
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,12 @@ - (void) _drawGearIcon
690690

691691
float margin = 5.0;
692692
NSImage *gearImage = [NSImage imageNamed:@"NSActionTemplate"];
693+
// On systems older than 10.5 we need to supply our own image.
694+
if (gearImage == nil)
695+
{
696+
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"NSActionTemplate" ofType:@"png"];
697+
gearImage = [[[NSImage alloc] initWithContentsOfFile:path] autorelease];
698+
}
693699

694700
if( gearImage ) {
695701
CGContextRef context = [ [ NSGraphicsContext currentContext ] graphicsPort ];

0 commit comments

Comments
 (0)