diff options
author | Johan Paulsson <gonz@Akita.local> | 2013-12-01 13:23:59 -0800 |
---|---|---|
committer | Johan Paulsson <gonz@Akita.local> | 2013-12-01 13:23:59 -0800 |
commit | 2b7726352d1d422d4284618c8762637f64ec9a68 (patch) | |
tree | a1a3194acd6aaa2054b34eaee3ef38a34977124e /tikzit/src/osx/DraggablePDFView.m | |
parent | 2c0baccbe99f52c402d6c0f9882192477c9b5246 (diff) |
osx gui: Fixed dragging of the preview pdf to all applications.
Diffstat (limited to 'tikzit/src/osx/DraggablePDFView.m')
-rw-r--r-- | tikzit/src/osx/DraggablePDFView.m | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tikzit/src/osx/DraggablePDFView.m b/tikzit/src/osx/DraggablePDFView.m index ce57473..ce393c7 100644 --- a/tikzit/src/osx/DraggablePDFView.m +++ b/tikzit/src/osx/DraggablePDFView.m @@ -38,17 +38,21 @@ - (void)mouseDown:(NSEvent *)theEvent { - NSPasteboard *pboard; - NSRect pageBox = [[[self document] pageAtIndex:0] boundsForBox:kPDFDisplayBoxMediaBox]; NSRect pageRect= [self convertRect:pageBox fromPage:[[self document] pageAtIndex:0]]; - pboard = [NSPasteboard pasteboardWithName:NSDragPboard]; - [pboard declareTypes:[NSArray arrayWithObject:NSPasteboardTypePDF] owner:self]; - [pboard setData:[[self document] dataRepresentation] forType:NSPasteboardTypePDF]; + NSArray *fileList = [NSArray arrayWithObjects:[[[self document] documentURL] path], nil]; + NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard]; + [pboard declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:nil]; + [pboard setPropertyList:fileList forType:NSFilenamesPboardType]; - [self dragImage:[[NSImage alloc] initWithData:[[self document] dataRepresentation]] at:pageRect.origin offset:pageRect.size - event:theEvent pasteboard:pboard source:self slideBack:YES]; + [self dragImage:[[NSImage alloc] initWithData:[[self document] dataRepresentation]] + at:pageRect.origin + offset:pageRect.size + event:theEvent + pasteboard:pboard + source:self + slideBack:YES]; return; } |