mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-18 12:28:37 +01:00
32 lines
641 B
Swift
32 lines
641 B
Swift
//
|
|
// SidebarContextualMenuDelegate.swift
|
|
// Evergreen
|
|
//
|
|
// Created by Brent Simmons on 2/7/18.
|
|
// Copyright © 2018 Ranchero Software. All rights reserved.
|
|
//
|
|
|
|
import AppKit
|
|
import RSCore
|
|
|
|
@objc final class SidebarContextualMenuDelegate: NSObject, NSMenuDelegate {
|
|
|
|
@IBOutlet weak var sidebarViewController: SidebarViewController?
|
|
|
|
public func menuNeedsUpdate(_ menu: NSMenu) {
|
|
|
|
guard let sidebarViewController = sidebarViewController else {
|
|
return
|
|
}
|
|
|
|
menu.removeAllItems()
|
|
|
|
guard let contextualMenu = sidebarViewController.contextualMenuForClickedRows() else {
|
|
return
|
|
}
|
|
|
|
menu.takeItems(from: contextualMenu)
|
|
}
|
|
}
|
|
|