Merge pull request #6490 from wilsonpage/add-drop-text-support
Add support for dropped text in osx
This commit is contained in:
commit
16e43a7f15
7 changed files with 27 additions and 1 deletions
|
@ -44,7 +44,10 @@ const CGFloat kVerticalTitleMargin = 2;
|
|||
inMouseEventSequence_ = NO;
|
||||
|
||||
if ((self = [super initWithFrame: CGRectZero])) {
|
||||
[self registerForDraggedTypes: @[NSFilenamesPboardType]];
|
||||
[self registerForDraggedTypes: @[
|
||||
NSFilenamesPboardType,
|
||||
NSStringPboardType,
|
||||
]];
|
||||
|
||||
// Create the status item.
|
||||
NSStatusItem * item = [[NSStatusBar systemStatusBar]
|
||||
|
@ -307,7 +310,12 @@ const CGFloat kVerticalTitleMargin = 2;
|
|||
dropFiles.push_back(base::SysNSStringToUTF8(file));
|
||||
trayIcon_->NotifyDropFiles(dropFiles);
|
||||
return YES;
|
||||
} else if ([[pboard types] containsObject:NSStringPboardType]) {
|
||||
NSString* dropText = [pboard stringForType:NSStringPboardType];
|
||||
trayIcon_->NotifyDropText(base::SysNSStringToUTF8(dropText));
|
||||
return YES;
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue