From 500140d5a24e31682ffe7e180820db4251fb0ce4 Mon Sep 17 00:00:00 2001 From: michael starke Date: Wed, 22 Jan 2014 11:52:36 +0100 Subject: [PATCH] Simple approach to fix Issue #137. Tab navigates to the entry view after the "done" button --- MacPass/ContextBar.xib | 2 ++ MacPass/MPContextBarViewController.h | 1 + MacPass/MPContextBarViewController.m | 9 ++++++++- MacPass/MPEntryViewController.m | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/MacPass/ContextBar.xib b/MacPass/ContextBar.xib index 8702e8d8..8d47374b 100644 --- a/MacPass/ContextBar.xib +++ b/MacPass/ContextBar.xib @@ -8,6 +8,7 @@ + @@ -16,6 +17,7 @@ + diff --git a/MacPass/MPContextBarViewController.h b/MacPass/MPContextBarViewController.h index 032845ec..7aca70e5 100644 --- a/MacPass/MPContextBarViewController.h +++ b/MacPass/MPContextBarViewController.h @@ -32,6 +32,7 @@ typedef NS_OPTIONS(NSUInteger, MPFilterModeType) { @property (nonatomic, assign) MPFilterModeType filterMode; @property (nonatomic, readonly) BOOL hasFilter; @property (nonatomic, weak) id delegate; +@property (weak) NSView *nextKeyView; - (NSString *)filterString; - (NSArray *)filterPredicates; diff --git a/MacPass/MPContextBarViewController.m b/MacPass/MPContextBarViewController.m index 5c94e1b4..5dcaa807 100644 --- a/MacPass/MPContextBarViewController.m +++ b/MacPass/MPContextBarViewController.m @@ -36,6 +36,8 @@ typedef NS_ENUM(NSUInteger, MPContextTab) { @property (weak) IBOutlet NSSearchField *filterSearchField; /* History */ @property (weak) IBOutlet HNHGradientView *historyBar; +@property (weak) IBOutlet NSTextField *historyLabel; +@property (weak) IBOutlet NSButton *exitHistoryButton; /* Trash*/ @property (weak) IBOutlet HNHGradientView *trashBar; @property (weak) IBOutlet NSButton *emptyTrashButton; @@ -86,7 +88,12 @@ typedef NS_ENUM(NSUInteger, MPContextTab) { self.trashBar.activeGradient = [[NSGradient alloc] initWithColors:activeColors]; self.trashBar.inactiveGradient = [[NSGradient alloc] initWithColors:inactiveColors]; [[self view] bind:NSSelectedIndexBinding toObject:self withKeyPath:@"activeTab" options:nil]; - + + if(self.nextKeyView) { + [self.exitHistoryButton setNextKeyView:self.nextKeyView]; + [self.emptyTrashButton setNextKeyView:self.nextKeyView]; + [self.filterDoneButton setNextKeyView:self.nextKeyView]; + } } #pragma mark Properties diff --git a/MacPass/MPEntryViewController.m b/MacPass/MPEntryViewController.m index afc15647..99f9c3d5 100644 --- a/MacPass/MPEntryViewController.m +++ b/MacPass/MPEntryViewController.m @@ -96,7 +96,6 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; _dataSource.viewController = self; _menuDelegate = [[MPEntryContextMenuDelegate alloc] init]; _contextBarViewController = [[MPContextBarViewController alloc] init]; - } return self; } @@ -125,6 +124,7 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; object:_entryTable]; /* Filter bar notifications */ self.contextBarViewController.delegate = self; + self.contextBarViewController.nextKeyView = self.entryTable; [self _setupEntryMenu]; NSTableColumn *parentColumn = [self.entryTable tableColumns][0];