From cbbf55e0c576857d53290249325e727402252865 Mon Sep 17 00:00:00 2001 From: michael starke Date: Sun, 16 Jun 2013 00:57:44 +0200 Subject: [PATCH] Started support for file attachments --- MacPass/Base.lproj/InspectorView.xib | 935 +++++++++++++++++++++++++-- MacPass/MPEntryViewController.m | 6 +- MacPass/MPInspectorViewController.h | 5 +- MacPass/MPInspectorViewController.m | 71 +- MacPass/MPOutlineDataSource.m | 1 + MacPass/MPPopupImageView.m | 45 +- MacPass/MacPass-Info.plist | 2 +- 7 files changed, 978 insertions(+), 87 deletions(-) diff --git a/MacPass/Base.lproj/InspectorView.xib b/MacPass/Base.lproj/InspectorView.xib index b24b7cfe..031aae93 100644 --- a/MacPass/Base.lproj/InspectorView.xib +++ b/MacPass/Base.lproj/InspectorView.xib @@ -18,6 +18,11 @@ NSCustomView NSImageCell NSImageView + NSScrollView + NSScroller + NSTableCellView + NSTableColumn + NSTableView NSTextField NSTextFieldCell NSView @@ -46,7 +51,7 @@ 268 - {{40, 313}, {35, 14}} + {{48, 334}, {35, 14}} @@ -67,7 +72,7 @@ 6 System controlColor - + 3 MC42NjY2NjY2NjY3AA @@ -87,7 +92,7 @@ 268 - {{80, 309}, {165, 22}} + {{88, 330}, {164, 22}} @@ -109,7 +114,7 @@ 6 System textBackgroundColor - + 3 MQA @@ -129,7 +134,7 @@ 268 - {{17, 281}, {58, 14}} + {{17, 302}, {66, 14}} @@ -150,7 +155,7 @@ 268 - {{80, 277}, {165, 22}} + {{88, 298}, {164, 22}} @@ -172,7 +177,7 @@ 268 - {{80, 245}, {165, 22}} + {{88, 266}, {164, 22}} @@ -194,7 +199,7 @@ 268 - {{50, 249}, {25, 14}} + {{58, 270}, {25, 14}} @@ -215,7 +220,7 @@ 268 - {{20, 195}, {55, 14}} + {{28, 216}, {55, 14}} @@ -244,7 +249,7 @@ NeXT Encapsulated PostScript v1.2 pasteboard type NeXT TIFF v4.0 pasteboard type - {{20, 360}, {48, 48}} + {{20, 381}, {48, 48}} @@ -269,7 +274,7 @@ 268 - {{73, 376}, {175, 17}} + {{73, 397}, {182, 17}} @@ -284,7 +289,7 @@ _NS:1535 - + 6 System controlTextColor @@ -296,7 +301,7 @@ 268 - {{20, 350}, {225, 2}} + {{20, 371}, {232, 2}} @@ -306,7 +311,7 @@ 268 - {{80, 191}, {165, 22}} + {{88, 212}, {164, 22}} @@ -329,7 +334,7 @@ 268 - {265, 30} + {272, 30} _NS:9 @@ -338,10 +343,10 @@ 268 - {{80, 164}, {165, 19}} + {{88, 185}, {164, 19}} - + _NS:9 {250, 750} YES @@ -349,7 +354,7 @@ -2080374784 134217728 Generate - + LucidaGrande 12 16 @@ -365,8 +370,197 @@ NO + + + 268 + + + + 2304 + + + + 256 + + {232, 100} + + + + _NS:13 + YES + NO + YES + + + -2147483392 + {{224, 0}, {16, 17}} + + _NS:19 + + + + 229 + 40 + 1000 + + 75497536 + 2048 + + + + 3 + MC4zMzMzMzI5ODU2AA + + + 6 + System + headerTextColor + + + + + 337641536 + 2048 + Text Cell + + + + 6 + System + controlBackgroundColor + + + + + 3 + YES + YES + + + + 3 + 2 + + + 6 + System + gridColor + + 3 + MC41AA + + + 17 + 373293056 + + + 4 + 15 + 0 + YES + 1 + 1 + + + {232, 100} + + + + _NS:11 + + + 2 + + + + -2147483392 + {{224, 17}, {15, 102}} + + + + _NS:58 + NO + + _doScroller: + 0.9925373134328358 + + + + -2147483392 + {{1, 119}, {223, 15}} + + + + _NS:60 + NO + 1 + + _doScroller: + 0.99581589958159 + + + {{20, 48}, {232, 100}} + + + + _NS:9 + 133680 + + + + QSAAAEEgAABBmAAAQZgAAA + 0.25 + 4 + 1 + + + + 268 + {{17, 156}, {72, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + Attachments + + _NS:1535 + + + + + NO + + + + 268 + {{190, 155}, {62, 19}} + + + + _NS:9 + YES + + -2080374784 + 134217728 + Add File + + _NS:9 + + -2038153216 + 164 + + + 400 + 75 + + NO + - {265, 428} + {272, 449} @@ -463,6 +657,91 @@ 733 + + + attachmentTableView + + + + 893 + + + + imageView + + + 274 + + + + 268 + + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + {{3, 0}, {17, 17}} + + + _NS:11 + YES + + 134217728 + 33554432 + + NSImage + NSFollowLinkFreestandingTemplate + + _NS:11 + 0 + 0 + 0 + NO + + NO + YES + + + + 266 + {{25, 0}, {204, 17}} + + + _NS:20 + {250, 750} + YES + + 67108928 + 272631808 + Table View Cell + + _NS:20 + + + + + NO + + + {{1, 1}, {229, 17}} + + _NS:9 + + + + 838 + + + + textField + + + + 839 + @@ -558,6 +837,134 @@ 29 3 + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 3 + 0 + + 3 + 1 + + 301 + + 1000 + + 3 + 9 + 3 + + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 4 + 1 + + 4 + 1 + + 48 + + 1000 + + 9 + 40 + 3 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + 5 @@ -1067,6 +1474,9 @@ + + + @@ -1191,7 +1601,7 @@ - + 7 0 @@ -1199,7 +1609,7 @@ 0 1 - 52 + 60 1000 @@ -1210,11 +1620,6 @@ - - 565 - - - 498 @@ -1355,11 +1760,6 @@ - - 639 - - - 636 @@ -1411,11 +1811,6 @@ - - 661 - - - 662 @@ -1487,11 +1882,6 @@ - - 708 - - - 725 @@ -1507,6 +1897,358 @@ + + 565 + + + + + 806 + + + + + + + + 8 + 0 + + 0 + 1 + + 100 + + 1000 + + 9 + 40 + 1 + + + + + + 807 + + + + + + + + 808 + + + + + 810 + + + + + 811 + + + + + + + + + 814 + + + + + 833 + + + + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 5 + 22 + 2 + + + + 6 + 0 + + 6 + 1 + + 3 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 3 + 0 + + 3 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 3 + + 1000 + + 8 + 29 + 3 + + + + + + 834 + + + + + + 8 + 0 + + 0 + 1 + + 17 + + 1000 + + 3 + 9 + 1 + + + + 7 + 0 + + 0 + 1 + + 17 + + 1000 + + 3 + 9 + 1 + + + + + + 835 + + + + + + + + 836 + + + + + 837 + + + + + 840 + + + + + 841 + + + + + 844 + + + + + 845 + + + + + 846 + + + + + 848 + + + + + 849 + + + + + 851 + + + + + 639 + + + + + 860 + + + + + + 8 + 0 + + 0 + 1 + + 17 + + 1000 + + 3 + 9 + 1 + + + + + + 861 + + + + + 864 + + + + + 868 + + + + + 874 + + + + + 875 + + + + + 873 + + + + + 886 + + + + + 850 + + + + + 889 + + + + + + + + 890 + + + + + 891 + + + + + 892 + + + + + 894 + + + + + 895 + + + @@ -1517,7 +2259,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + @@ -1549,6 +2291,14 @@ + + + + + + + + @@ -1564,7 +2314,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin @@ -1629,7 +2379,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin @@ -1645,16 +2394,76 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin - 733 + 895 @@ -1701,23 +2510,15 @@ MPInspectorViewController MPViewController - - _popUpPasswordGenerator: - id - - - _popUpPasswordGenerator: - - _popUpPasswordGenerator: - id - - NSTextField + NSTableView HNHGradientView NSButton + NSTextField MPPopupImageView NSTextField + NSTextField NSTextField NSTextField NSTextField @@ -1728,6 +2529,10 @@ URLTextField NSTextField + + attachmentTableView + NSTableView + bottomBar HNHGradientView @@ -1736,6 +2541,10 @@ generatePasswordButton NSButton + + infoTextField + NSTextField + itemImageView MPPopupImageView @@ -1744,6 +2553,10 @@ itemNameTextfield NSTextField + + notesTextField + NSTextField + passwordTextField NSTextField @@ -1796,10 +2609,10 @@ IBCocoaFramework YES 3 - - NSApplicationIcon - {128, 128} - + + {128, 128} + {10, 10} + YES diff --git a/MacPass/MPEntryViewController.m b/MacPass/MPEntryViewController.m index 018a8655..92ed73fc 100644 --- a/MacPass/MPEntryViewController.m +++ b/MacPass/MPEntryViewController.m @@ -132,11 +132,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername"; NSTableColumn *userNameColumn = [self.entryTable tableColumns][2]; NSTableColumn *passwordColumn = [self.entryTable tableColumns][3]; NSTableColumn *urlColumn = [self.entryTable tableColumns][4]; - - for(NSTableColumn *column in [self.entryTable tableColumns]) { - [column setHeaderCell:[[HNHTableHeaderCell alloc] init]]; - } - + [parentColumn setIdentifier:MPEntryTableParentColumnIdentifier]; [titleColumn setIdentifier:MPEntryTableTitleColumnIdentifier]; diff --git a/MacPass/MPInspectorViewController.h b/MacPass/MPInspectorViewController.h index b8d0d2ec..aa875d9e 100644 --- a/MacPass/MPInspectorViewController.h +++ b/MacPass/MPInspectorViewController.h @@ -14,7 +14,7 @@ @class HNHGradientView; @class MPDocumentWindowController; -@interface MPInspectorViewController : MPViewController +@interface MPInspectorViewController : MPViewController @property (assign) IBOutlet MPPopupImageView *itemImageView; @property (assign) IBOutlet NSTextField *itemNameTextfield; @@ -24,7 +24,10 @@ @property (assign) IBOutlet NSTextField *URLTextField; @property (assign) IBOutlet NSTextField *passwordTextField; @property (assign) IBOutlet NSTextField *titleOrNameLabel; +@property (assign) IBOutlet NSTextField *notesTextField; @property (assign) IBOutlet HNHGradientView *bottomBar; +@property (assign) IBOutlet NSTextField *infoTextField; +@property (assign) IBOutlet NSTableView *attachmentTableView; - (void)closeActivePopup:(id)sender; /* Seperate call to ensure alle registered objects are in place */ diff --git a/MacPass/MPInspectorViewController.m b/MacPass/MPInspectorViewController.m index 9e4c37bf..752d696a 100644 --- a/MacPass/MPInspectorViewController.m +++ b/MacPass/MPInspectorViewController.m @@ -18,6 +18,7 @@ #import "MPOutlineViewController.h" #import "MPOutlineViewDelegate.h" #import "KdbLib.h" +#import "Kdb4Node.h" #import "KdbGroup+Undo.h" #import "KdbEntry+Undo.h" #import "HNHGradientView.h" @@ -32,6 +33,9 @@ @property (assign, nonatomic) BOOL showsEntry; @property (retain) NSPopover *activePopover; @property (assign) IBOutlet NSButton *generatePasswordButton; +@property (nonatomic, assign) NSDate *modificationDate; +@property (nonatomic, assign) NSDate *creationDate; +@property (retain, nonatomic) NSArrayController *attachmentController; @end @@ -47,21 +51,27 @@ _selectedEntry = nil; _selectedGroup = nil; _showsEntry = NO; + _attachmentController = [[NSArrayController alloc] init]; } return self; } - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; + [_attachmentController release]; [_activePopover release]; [super dealloc]; } - (void)didLoadView { - [[self.itemImageView cell] setBackgroundStyle:NSBackgroundStyleRaised]; [self.itemImageView setTarget:self]; [_bottomBar setBorderType:HNHBorderTop]; + [[_infoTextField cell] setBackgroundStyle:NSBackgroundStyleRaised]; + [_attachmentTableView setDelegate:self]; + [_attachmentTableView bind:NSContentBinding toObject:_attachmentController withKeyPath:@"arrangedObjects" options:nil]; + [_attachmentTableView setHidden:YES]; + [self _clearContent]; } @@ -79,6 +89,28 @@ object:windowController.outlineViewController.outlineDelegate]; } +- (void)_updateInfoString { + NSDate *modificationDate; + NSDate *creationDate; + if(_showsEntry) { + modificationDate = self.selectedEntry.lastModificationTime; + creationDate = self.selectedEntry.creationTime; + } + else { + modificationDate = self.selectedGroup.lastModificationTime; + creationDate = self.selectedGroup.creationTime; + } + [self.infoTextField setStringValue:[NSString stringWithFormat:@"created: %@ modified: %@", creationDate, modificationDate]]; +} + +- (void)setModificationDate:(NSDate *)modificationDate { + [self _updateInfoString]; +} + +- (void)setCreationDate:(NSDate *)creationDate { + [self _updateInfoString]; +} + - (void)_updateContent { if(self.showsEntry && self.selectedEntry) { [self _showEntry]; @@ -89,9 +121,14 @@ else { [self _clearContent]; } + [self _updateAttachments]; } - (void)_showEntry { + + [self bind:@"modificationDate" toObject:self.selectedEntry withKeyPath:@"lastModificationTime" options:nil]; + [self bind:@"creationDate" toObject:self.selectedEntry withKeyPath:@"creationTime" options:nil]; + [self.itemNameTextfield bind:NSValueBinding toObject:self.selectedEntry withKeyPath:MPEntryTitleUndoableKey options:nil]; [self.itemImageView setImage:[MPIconHelper icon:(MPIconType)self.selectedEntry.image ]]; [self.passwordTextField bind:NSValueBinding toObject:self.selectedEntry withKeyPath:MPEntryPasswordUndoableKey options:nil]; @@ -99,11 +136,15 @@ [self.titleOrNameLabel setStringValue:NSLocalizedString(@"TITLE",@"")]; [self.titleTextField bind:NSValueBinding toObject:self.selectedEntry withKeyPath:MPEntryTitleUndoableKey options:nil]; [self.URLTextField bind:NSValueBinding toObject:self.selectedEntry withKeyPath:MPEntryUrlUndoableKey options:nil]; + [self.notesTextField bind:NSValueBinding toObject:self.selectedEntry withKeyPath:MPEntryNotesUndoableKey options:nil]; [self _setInputEnabled:YES]; } - (void)_showGroup { + [self bind:@"modificationDate" toObject:self.selectedGroup withKeyPath:@"lastModificationTime" options:nil]; + [self bind:@"creationDate" toObject:self.selectedGroup withKeyPath:@"creationTime" options:nil]; + [self.itemNameTextfield bind:NSValueBinding toObject:self.selectedGroup withKeyPath:MPGroupNameUndoableKey options:nil]; [self.itemImageView setImage:[MPIconHelper icon:(MPIconType)self.selectedGroup.image ]]; [self.titleOrNameLabel setStringValue:NSLocalizedString(@"NAME",@"")]; @@ -118,6 +159,7 @@ [self.passwordTextField setStringValue:@""]; [self.usernameTextField setStringValue:@""]; [self.URLTextField setStringValue:@""]; + [self.notesTextField setStringValue:@""]; [self _setInputEnabled:YES]; } @@ -131,6 +173,7 @@ [self.usernameTextField unbind:NSValueBinding]; [self.titleTextField unbind:NSValueBinding]; [self.URLTextField unbind:NSValueBinding]; + [self.notesTextField unbind:NSValueBinding]; [self.itemNameTextfield setStringValue:NSLocalizedString(@"INSPECTOR_NO_SELECTION", @"No item selected in inspector")]; [self.itemImageView setImage:[NSImage imageNamed:NSImageNameActionTemplate]]; @@ -140,6 +183,7 @@ [self.usernameTextField setStringValue:@""]; [self.titleTextField setStringValue:@""]; [self.URLTextField setStringValue:@""]; + [self.notesTextField setStringValue:@""]; } @@ -156,9 +200,23 @@ [self.usernameTextField setEnabled:enabled]; [self.URLTextField setEnabled:enabled]; [self.generatePasswordButton setEnabled:enabled]; + [self.notesTextField setEditable:enabled]; } +- (void)_updateAttachments { + if(self.selectedEntry && self.showsEntry) { + if([self.selectedEntry isKindOfClass:[Kdb4Entry class]]) { + [self.attachmentController bind:NSContentArrayBinding toObject:self.selectedEntry withKeyPath:@"binaries" options:nil]; + } + } + else { + [self.attachmentController unbind:NSContentArrayBinding]; + [self.attachmentController setContent:nil]; + } + [self.attachmentTableView setHidden:(0 == [[self.attachmentController arrangedObjects] count])]; +} + #pragma mark Actions - (void)_showImagePopup:(id)sender { @@ -212,4 +270,15 @@ [self _updateContent]; } } + +#pragma mark NSTableViewDelegate +- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { + NSTableCellView *tableCellView = [tableView makeViewWithIdentifier:[tableColumn identifier] owner:tableView]; + BinaryRef *binaryRef = [self.attachmentController arrangedObjects][row]; + [tableCellView.textField bind:NSValueBinding toObject:binaryRef withKeyPath:@"key" options:nil]; + [[tableCellView.textField cell] setBackgroundStyle:NSBackgroundStyleRaised]; + [[tableCellView.imageView cell] setBackgroundStyle:NSBackgroundStyleLight]; + return tableCellView; +} + @end diff --git a/MacPass/MPOutlineDataSource.m b/MacPass/MPOutlineDataSource.m index f83edad0..7f6719b2 100644 --- a/MacPass/MPOutlineDataSource.m +++ b/MacPass/MPOutlineDataSource.m @@ -80,6 +80,7 @@ MPDocument *document = [[[outlineView window] windowController] document]; KdbGroup *rootGroup = [document root]; KdbEntry *draggedEntry = [rootGroup entryForUUID:uuid]; + [uuid release]; if(draggedEntry) { if(draggedEntry.parent != target && index == NSOutlineViewDropOnItemIndex) { [document moveEntry:draggedEntry toGroup:target index:index]; diff --git a/MacPass/MPPopupImageView.m b/MacPass/MPPopupImageView.m index 217744e2..d572595e 100644 --- a/MacPass/MPPopupImageView.m +++ b/MacPass/MPPopupImageView.m @@ -44,28 +44,37 @@ if(self.showOverlay && [self isEnabled]) { [[NSGraphicsContext currentContext] saveGraphicsState]; - - [[NSColor colorWithCalibratedWhite:0 alpha:0.2] set]; - [[NSBezierPath bezierPathWithRoundedRect:[self bounds] xRadius:4 yRadius:4] fill]; + NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:[self bounds] xRadius:4 yRadius:4]; NSShadow *shadow = [[NSShadow alloc] init]; - [shadow setShadowBlurRadius:2]; - [shadow setShadowOffset:NSMakeSize(0, -1)]; - [shadow setShadowColor:[NSColor colorWithCalibratedWhite:0 alpha:0.5]]; + [shadow setShadowBlurRadius:6]; + [shadow setShadowOffset:NSMakeSize(0, 0)]; + [shadow setShadowColor:[NSColor colorWithCalibratedWhite:0.2 alpha:1]]; [shadow set]; - NSBezierPath *triangle = [NSBezierPath bezierPath]; - NSPoint left = NSMakePoint([self bounds].size.width - MPTRIANGLE_OFFSET - MPTRIANGLE_WIDTH, MPTRIANGLE_OFFSET + MPTRIANGLE_HEIGHT); - NSPoint right = NSMakePoint(left.x + MPTRIANGLE_WIDTH, left.y); - NSPoint bottom = NSMakePoint(left.x + 0.5 * MPTRIANGLE_WIDTH, MPTRIANGLE_OFFSET); - - [triangle moveToPoint:left]; - [triangle lineToPoint:right]; - [triangle lineToPoint:bottom]; - [triangle closePath]; - - [[NSColor whiteColor] set]; - [triangle fill]; + [path addClip]; + [[NSColor colorWithCalibratedWhite:1 alpha:0.2] setFill]; + [path fill]; + NSBezierPath *strokePath = [NSBezierPath bezierPathWithRoundedRect:NSInsetRect([self bounds], -3, -3) xRadius:4 yRadius:4]; + [strokePath setLineWidth:6]; + [strokePath stroke]; +// [shadow setShadowBlurRadius:2]; +// [shadow setShadowColor:[NSColor colorWithCalibratedWhite:0 alpha:0.5]]; +// [shadow setShadowOffset:NSMakeSize(0, -1)]; +// [shadow set]; +// +// NSBezierPath *triangle = [NSBezierPath bezierPath]; +// NSPoint left = NSMakePoint([self bounds].size.width - MPTRIANGLE_OFFSET - MPTRIANGLE_WIDTH, MPTRIANGLE_OFFSET + MPTRIANGLE_HEIGHT); +// NSPoint right = NSMakePoint(left.x + MPTRIANGLE_WIDTH, left.y); +// NSPoint bottom = NSMakePoint(left.x + 0.5 * MPTRIANGLE_WIDTH, MPTRIANGLE_OFFSET); +// +// [triangle moveToPoint:left]; +// [triangle lineToPoint:right]; +// [triangle lineToPoint:bottom]; +// [triangle closePath]; +// +// [[NSColor whiteColor] set]; +// [triangle fill]; [shadow release]; [[NSGraphicsContext currentContext] restoreGraphicsState]; diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist index 7d277df5..4231eb62 100644 --- a/MacPass/MacPass-Info.plist +++ b/MacPass/MacPass-Info.plist @@ -48,7 +48,7 @@ CFBundleSignature ???? CFBundleVersion - 219 + 322 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright