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:
commit
c0f0685296
1 changed files with 14 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue