Browse Source

ierge branch 'develop_PDFReaderProNew' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderProNew

tangchao 1 year ago
parent
commit
57931f7135

+ 5 - 8
PDF Office/PDF Master/Class/Home/View/HomeContentView/History/Cell/KMHomeHistoryCollectionItem.swift

@@ -126,6 +126,11 @@ class KMHomeHistoryCollectionItem: NSCollectionViewItem {
         self.showImageView.border(NSColor.clear, 1, 4)
         self.verticalTitleLabel.backgroundColor(NSColor.clear)
         self.verticalTitleLabel.textColor = KMAppearance.Layout.h0Color()
+        
+        let menu = NSMenu(title: "")
+        menu.addItem(NSMenuItem(title: NSLocalizedString("Show in Finder", comment: ""), action: #selector(showPathButtonAction), keyEquivalent: ""))
+        menu.addItem(NSMenuItem(title: NSLocalizedString("Remove from Recents", comment: ""), action: #selector(removePathButtonAction), keyEquivalent: ""))
+        self.view.menu = menu
     }
     
     func reloadData() {
@@ -134,14 +139,6 @@ class KMHomeHistoryCollectionItem: NSCollectionViewItem {
         self.updateTypeData()
         self.updateFilesData()
     }
-    
-    override func rightMouseDown(with event: NSEvent) {
-        let point = self.view.convert(event.locationInWindow, from: nil)
-        let menu = NSMenu(title: "")
-        menu.addItem(NSMenuItem(title: NSLocalizedString("Show in Finder", comment: ""), action: #selector(showPathButtonAction), keyEquivalent: ""))
-        menu.addItem(NSMenuItem(title: NSLocalizedString("Remove from Recents", comment: ""), action: #selector(removePathButtonAction), keyEquivalent: ""))
-        menu.popUp(positioning: nil, at: point, in: self.view)
-    }
 }
 
 extension KMHomeHistoryCollectionItem {