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