Merge pull request #3944 from nishanths/feature/tray-file-drop-osx-dock

tray: Support file-drop from OS X Dock
This commit is contained in:
Cheng Zhao 2015-12-29 19:59:24 +08:00
commit c0f0685296

View file

@ -281,14 +281,14 @@ const CGFloat kVerticalTitleMargin = 2;
- (void)draggingEnded:(id <NSDraggingInfo>)sender {
trayIcon_->NotifyDragEnded();
if (NSPointInRect([sender draggingLocation], self.frame)) {
trayIcon_->NotifyDrop();
[self handleDrop:sender];
}
}
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender {
trayIcon_->NotifyDrop();
return YES;
}
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender {
- (BOOL)handleDrop:(id <NSDraggingInfo>)sender {
NSPasteboard* pboard = [sender draggingPasteboard];
if ([[pboard types] containsObject:NSFilenamesPboardType]) {
@ -302,6 +302,14 @@ const CGFloat kVerticalTitleMargin = 2;
return NO;
}
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender {
return YES;
}
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender {
return YES;
}
- (BOOL)shouldHighlight {
if (isHighlightEnable_ && forceHighlight_)
return true;