spacebar in the Inspector file table will toggle QuickLook

This commit is contained in:
Mitchell Livingston 2009-09-04 22:42:03 +00:00
parent 6b1b1b4833
commit 2b76183eed
1 changed files with 17 additions and 0 deletions

View File

@ -28,6 +28,7 @@
#import "FilePriorityCell.h"
#import "Torrent.h"
#import "FileListNode.h"
#import <Quartz/Quartz.h>
@implementation FileOutlineView
@ -84,6 +85,22 @@
[super mouseDown: event];
}
- (void) keyDown: (NSEvent *) event
{
const unichar firstChar = [[event charactersIgnoringModifiers] characterAtIndex: 0];
//don't allow quick look on add window
if (firstChar == ' ' && [[[self window] windowController] conformsToProtocol: @protocol(QLPreviewPanelDataSource)])
{
if ([QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible])
[[QLPreviewPanel sharedPreviewPanel] orderOut: nil];
else
[[QLPreviewPanel sharedPreviewPanel] makeKeyAndOrderFront: nil];
}
[super keyDown: event];
}
- (NSMenu *) menuForEvent: (NSEvent *) event
{
int row = [self rowAtPoint: [self convertPoint: [event locationInWindow] fromView: nil]];