Permalink
Browse files

[NEW] Add iPod-style flash icon over the existing gradient to make it…

… insanely obvious that this is clickable Flash. (Ricky Romero, Justin Williams)
  • Loading branch information...
1 parent acf0b5a commit e56a9412f42c1cbb299f0693047c9275a94d0f24 @rentzsch committed Jan 28, 2009
Showing with 29 additions and 0 deletions.
  1. +6 −0 ClickToFlash.xcodeproj/project.pbxproj
  2. BIN Images/ContainerImage.png
  3. +23 −0 Plugin/Plugin.m
@@ -32,6 +32,8 @@
55EB70480E04A8850016593D /* Plugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 55EB703D0E04A84F0016593D /* Plugin.m */; };
55EB70580E04A8B80016593D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55EB70560E04A8B80016593D /* Cocoa.framework */; };
55EB70590E04A8B80016593D /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55EB70570E04A8B80016593D /* WebKit.framework */; };
+ D0FB700F0F2FE35000DCB854 /* ContainerImage.png in Resources */ = {isa = PBXBuildFile; fileRef = D0FB700E0F2FE35000DCB854 /* ContainerImage.png */; };
+ D0FB70100F2FE35000DCB854 /* ContainerImage.png in Resources */ = {isa = PBXBuildFile; fileRef = D0FB700E0F2FE35000DCB854 /* ContainerImage.png */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -70,6 +72,7 @@
55EB70560E04A8B80016593D /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
55EB70570E04A8B80016593D /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = "<absolute>"; };
55EB70610E04A8D00016593D /* Info-Plugin.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "Info-Plugin.plist"; path = "Plugin/Info-Plugin.plist"; sourceTree = "<group>"; };
+ D0FB700E0F2FE35000DCB854 /* ContainerImage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ContainerImage.png; path = Images/ContainerImage.png; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -96,6 +99,7 @@
558405520E0F2C2200EA991B /* Installer */ = {
isa = PBXGroup;
children = (
+ D0FB700E0F2FE35000DCB854 /* ContainerImage.png */,
558405530E0F2C2B00EA991B /* CTFInstaller.h */,
558405540E0F2C2B00EA991B /* CTFInstaller.m */,
558405560E0F2C4900EA991B /* Installer.xib */,
@@ -207,6 +211,7 @@
files = (
5584064B0E0F35A000EA991B /* ClickToFlash.plugin in Resources */,
5584056C0E0F2E0100EA991B /* Installer.xib in Resources */,
+ D0FB70100F2FE35000DCB854 /* ContainerImage.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -215,6 +220,7 @@
buildActionMask = 2147483647;
files = (
558405570E0F2C4900EA991B /* Installer.xib in Resources */,
+ D0FB700F0F2FE35000DCB854 /* ContainerImage.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -146,7 +146,30 @@ - (void) _drawBackground
[NSBezierPath setDefaultLineCapStyle:NSSquareLineCapStyle];
[[NSBezierPath bezierPathWithRect:strokeRect] stroke];
+ // Draw an image on top to make it insanely obvious that this is clickable Flash.
+ NSString *containerImageName = [[NSBundle bundleForClass:[self class]] pathForResource:@"ContainerImage" ofType:@"png"];
+ NSImage *containerImage = [[NSImage alloc] initWithContentsOfFile:containerImageName];
+
+ NSSize viewSize = fillRect.size;
+ NSSize imageSize = containerImage.size;
+
+ NSPoint viewCenter;
+ viewCenter.x = viewSize.width * 0.50;
+ viewCenter.y = viewSize.height * 0.50;
+
+ NSPoint imageOrigin = viewCenter;
+ imageOrigin.x -= imageSize.width * 0.50;
+ imageOrigin.y -= imageSize.height * 0.50;
+
+ NSRect destinationRect;
+ destinationRect.origin = imageOrigin;
+ destinationRect.size = imageSize;
+
+ // Draw the image centered in the view
+ [containerImage drawInRect:destinationRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
+
[gradient release];
+ [containerImage release];
}

0 comments on commit e56a941

Please sign in to comment.