Skip to content

Commit

Permalink
interface
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardelben committed Sep 5, 2011
1 parent 03bba63 commit 45e0a30
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 92 deletions.
8 changes: 4 additions & 4 deletions ColorPicker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

/* Begin PBXBuildFile section */
550A63CF1406567B00864125 /* NSColorFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 550A63CE1406567B00864125 /* NSColorFormatter.m */; };
55608EBA1412233E00670B82 /* preferences.png in Resources */ = {isa = PBXBuildFile; fileRef = 55608EB91412233E00670B82 /* preferences.png */; };
55A8833714151D5D0076BB4A /* NSScreen+PointConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = 55A8833614151D5D0076BB4A /* NSScreen+PointConversion.m */; };
55A8833A1415357E0076BB4A /* ColorPicker_menubar.png in Resources */ = {isa = PBXBuildFile; fileRef = 55A883391415357E0076BB4A /* ColorPicker_menubar.png */; };
55A8833C141539E10076BB4A /* APPL.icns in Resources */ = {isa = PBXBuildFile; fileRef = 55A8833B141539E10076BB4A /* APPL.icns */; };
55A8833E14153BCA0076BB4A /* close.png in Resources */ = {isa = PBXBuildFile; fileRef = 55A8833D14153BCA0076BB4A /* close.png */; };
55C9F16E1400FAF000321C9E /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C9F16D1400FAF000321C9E /* AppController.m */; };
55C9F1751400FB0200321C9E /* CustomStatusItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C9F1721400FB0200321C9E /* CustomStatusItem.m */; };
55C9F1761400FB0200321C9E /* CustomWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C9F1741400FB0200321C9E /* CustomWindow.m */; };
Expand All @@ -35,11 +35,11 @@
/* Begin PBXFileReference section */
550A63CD1406567B00864125 /* NSColorFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSColorFormatter.h; sourceTree = "<group>"; };
550A63CE1406567B00864125 /* NSColorFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSColorFormatter.m; sourceTree = "<group>"; };
55608EB91412233E00670B82 /* preferences.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = preferences.png; sourceTree = "<group>"; };
55A8833514151D5D0076BB4A /* NSScreen+PointConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSScreen+PointConversion.h"; sourceTree = "<group>"; };
55A8833614151D5D0076BB4A /* NSScreen+PointConversion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSScreen+PointConversion.m"; sourceTree = "<group>"; };
55A883391415357E0076BB4A /* ColorPicker_menubar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ColorPicker_menubar.png; sourceTree = "<group>"; };
55A8833B141539E10076BB4A /* APPL.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = APPL.icns; sourceTree = "<group>"; };
55A8833D14153BCA0076BB4A /* close.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = close.png; sourceTree = "<group>"; };
55C9F16C1400FAF000321C9E /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = "<group>"; };
55C9F16D1400FAF000321C9E /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppController.m; sourceTree = "<group>"; };
55C9F1701400FAF900321C9E /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -94,8 +94,8 @@
55608EB71412232100670B82 /* Images */ = {
isa = PBXGroup;
children = (
55608EB91412233E00670B82 /* preferences.png */,
55A883391415357E0076BB4A /* ColorPicker_menubar.png */,
55A8833D14153BCA0076BB4A /* close.png */,
);
path = Images;
sourceTree = "<group>";
Expand Down Expand Up @@ -250,9 +250,9 @@
55D4EC9013FFF18D00D13344 /* Credits.rtf in Resources */,
55D4EC9613FFF18D00D13344 /* MainMenu.xib in Resources */,
55C9F18D140240CE00321C9E /* ColorPickerView.xib in Resources */,
55608EBA1412233E00670B82 /* preferences.png in Resources */,
55A8833A1415357E0076BB4A /* ColorPicker_menubar.png in Resources */,
55A8833C141539E10076BB4A /* APPL.icns in Resources */,
55A8833E14153BCA0076BB4A /* close.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
17 changes: 15 additions & 2 deletions ColorPicker/ColorHistoryView.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,24 @@ @implementation ColorHistoryView

- (void)drawRect:(NSRect)dirtyRect
{

if (!color)
return;

color = [NSColor whiteColor];
[color set];

NSRectFill(dirtyRect);

NSBezierPath *path = [NSBezierPath bezierPath];

[path moveToPoint:dirtyRect.origin];
[path lineToPoint:NSMakePoint(dirtyRect.origin.x, NSMaxY(dirtyRect))];
[path lineToPoint:NSMakePoint(NSMaxX(dirtyRect), NSMaxY(dirtyRect))];
[path lineToPoint:NSMakePoint(NSMaxX(dirtyRect), dirtyRect.origin.y)];
[path closePath];

[[NSColor lightGrayColor] set];
[path stroke];
}

- (void)mouseDown:(NSEvent *)theEvent
Expand Down
2 changes: 1 addition & 1 deletion ColorPicker/ColorPicker-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>LSUIElement</key>
<true/>
<false/>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2011 DibiStore. All rights reserved.</string>
<key>NSMainNibFile</key>
Expand Down
12 changes: 12 additions & 0 deletions ColorPicker/ColorPickerPreview.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ - (void)drawRect:(NSRect)dirtyRect
[path lineToPoint:NSMakePoint(pickerRectX + dirtyRect.size.width / 2, pickerRectY)];

[path stroke];

// Draw border
//NSBezierPath *path = [NSBezierPath bezierPath];

[path moveToPoint:dirtyRect.origin];
[path lineToPoint:NSMakePoint(dirtyRect.origin.x, NSMaxY(dirtyRect))];
[path lineToPoint:NSMakePoint(NSMaxX(dirtyRect), NSMaxY(dirtyRect))];
[path lineToPoint:NSMakePoint(NSMaxX(dirtyRect), dirtyRect.origin.y)];
[path closePath];

[[NSColor lightGrayColor] set];
[path stroke];
}

@end
Loading

0 comments on commit 45e0a30

Please sign in to comment.