mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 12:52:21 +00:00
added support for last top visible entry in entry view but kept it disabled for now
This commit is contained in:
@@ -129,6 +129,14 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
|||||||
selector:@selector(_didBecomFirstResponder:)
|
selector:@selector(_didBecomFirstResponder:)
|
||||||
name:MPDidActivateViewNotification
|
name:MPDidActivateViewNotification
|
||||||
object:_entryTable];
|
object:_entryTable];
|
||||||
|
/*
|
||||||
|
NSView *clipView = self.entryTable.enclosingScrollView.contentView;
|
||||||
|
[NSNotificationCenter.defaultCenter addObserver:self
|
||||||
|
selector:@selector(_tableDidScroll:)
|
||||||
|
name:NSViewBoundsDidChangeNotification
|
||||||
|
object:clipView];
|
||||||
|
*/
|
||||||
|
|
||||||
[self _setupEntryMenu];
|
[self _setupEntryMenu];
|
||||||
|
|
||||||
NSTableColumn *parentColumn = self.entryTable.tableColumns[0];
|
NSTableColumn *parentColumn = self.entryTable.tableColumns[0];
|
||||||
@@ -239,10 +247,24 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
|||||||
|
|
||||||
#pragma mark NSTableViewDelgate
|
#pragma mark NSTableViewDelgate
|
||||||
|
|
||||||
- (void)tableView:(NSTableView *)tableView didAddRowView:(NSTableRowView *)rowView forRow:(NSInteger)row {
|
- (void)_tableDidScroll:(NSNotification *)notification {
|
||||||
/*
|
if(self.displayMode != MPDisplayModeEntries) {
|
||||||
bind background color to entry color
|
return; // Only update on entry display
|
||||||
*/
|
}
|
||||||
|
|
||||||
|
NSView *clipView = notification.object;
|
||||||
|
if(nil == clipView || self.entryTable.enclosingScrollView.contentView != clipView) {
|
||||||
|
return; // Wrong view
|
||||||
|
}
|
||||||
|
/* padding to compensate for clipped items */
|
||||||
|
CGPoint point = CGPointMake(clipView.bounds.origin.x, clipView.bounds.origin.y + self.entryTable.headerView.frame.size.height);
|
||||||
|
NSInteger topRow = [self.entryTable rowAtPoint:point];
|
||||||
|
|
||||||
|
if(topRow > -1) {
|
||||||
|
KPKEntry *entry = self.entryArrayController.arrangedObjects[topRow];
|
||||||
|
entry.parent.lastTopVisibleEntry = entry.uuid;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
|
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
|
||||||
|
|||||||
Reference in New Issue
Block a user