NetNewsWire/Evergreen/MainWindow/Timeline/TimelineContextualMenuDelegate.swift
2018-02-09 23:16:12 -08:00

33 lines
649 B
Swift

//
// TimelineContextualMenuDelegate.swift
// Evergreen
//
// Created by Brent Simmons on 2/8/18.
// Copyright © 2018 Ranchero Software. All rights reserved.
//
import AppKit
import RSCore
@objc final class TimelineContextualMenuDelegate: NSObject, NSMenuDelegate {
@IBOutlet weak var timelineViewController: TimelineViewController?
public func menuNeedsUpdate(_ menu: NSMenu) {
guard let timelineViewController = timelineViewController else {
return
}
menu.removeAllItems()
guard let contextualMenu = timelineViewController.contextualMenuForClickedRows() else {
return
}
menu.takeItems(from: contextualMenu)
}
}