mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Make the On My Mac account node the drop target when the drop target is otherwise invalid — when dropping nonlocal feeds (URLs, etc. from outside). This way you don’t have to be too precise — you can drag anywhere into the sidebar to add a feed.
This commit is contained in:
@@ -195,10 +195,14 @@ private extension SidebarOutlineDataSource {
|
||||
}
|
||||
|
||||
func ancestorThatCanAcceptNonLocalFeed(_ node: Node) -> Node? {
|
||||
// Default to the On My Mac account, if needed, so we can always accept a nonlocal feed drop.
|
||||
if nodeIsDropTarget(node) {
|
||||
return node
|
||||
}
|
||||
guard let parentNode = node.parent else {
|
||||
if let onMyMacAccountNode = treeController.nodeInTreeRepresentingObject(AccountManager.shared.localAccount) {
|
||||
return onMyMacAccountNode
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return ancestorThatCanAcceptNonLocalFeed(parentNode)
|
||||
@@ -208,7 +212,7 @@ private extension SidebarOutlineDataSource {
|
||||
guard nodeIsDropTarget(parentNode), index == NSOutlineViewDropOnItemIndex else {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
// Show the add-feed sheet.
|
||||
let folder = parentNode.representedObject as? Folder
|
||||
appDelegate.addFeed(draggedFeed.url, name: nil, folder: folder)
|
||||
|
||||
Reference in New Issue
Block a user