NetNewsWire/Evergreen/MainWindow/Timeline/TimelineContextualMenuDelegate.swift

33 lines
649 B
Swift
Raw Normal View History

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