Allow article drag from timeline view to other apps. Write URL on dragging.
This commit is contained in:
parent
b79ded1eb9
commit
06de21776a
|
@ -29,6 +29,9 @@ import Data
|
||||||
if let _ = article.title {
|
if let _ = article.title {
|
||||||
types += [.string]
|
types += [.string]
|
||||||
}
|
}
|
||||||
|
if let link = article.preferredLink, let _ = URL(string: link) {
|
||||||
|
types += [.URL]
|
||||||
|
}
|
||||||
|
|
||||||
return types // TODO: add types
|
return types // TODO: add types
|
||||||
}
|
}
|
||||||
|
@ -42,6 +45,8 @@ import Data
|
||||||
switch type {
|
switch type {
|
||||||
case .string:
|
case .string:
|
||||||
plist = article.title ?? ""
|
plist = article.title ?? ""
|
||||||
|
case .URL:
|
||||||
|
plist = article.preferredLink ?? ""
|
||||||
default:
|
default:
|
||||||
plist = nil
|
plist = nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,8 @@ class TimelineViewController: NSViewController, KeyboardDelegate, UndoableComman
|
||||||
tableView.target = self
|
tableView.target = self
|
||||||
tableView.doubleAction = #selector(openArticleInBrowser(_:))
|
tableView.doubleAction = #selector(openArticleInBrowser(_:))
|
||||||
tableView.keyboardDelegate = self
|
tableView.keyboardDelegate = self
|
||||||
|
tableView.setDraggingSourceOperationMask(.copy, forLocal: true)
|
||||||
|
tableView.setDraggingSourceOperationMask(.copy, forLocal: false)
|
||||||
|
|
||||||
if !didRegisterForNotifications {
|
if !didRegisterForNotifications {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue