Преглед на файлове

【BOTA】缩略图、大纲、书签列表单击列表中其他空白位置取消选中的逻辑也要拿掉

lizhe преди 1 година
родител
ревизия
ba35d2a869

+ 11 - 0
PDF Office/PDF Master/Class/Common/Control/KMThumbnailView.swift

@@ -77,6 +77,17 @@ private let _KMThumbnailView_collectionViewDrop_lineViewClassName = "NSCollectio
         
         super.addSubview(view)
     }
+    
+    override func mouseDown(with event: NSEvent) {
+        let point = convert(event.locationInWindow, from: nil)
+        
+        if let indexPath = indexPathForItem(at: point) {
+            // 用户点击了一个项,处理点击事件
+            super.mouseDown(with: event)
+        } else {
+            // 用户点击了空白区域,不取消选中项
+        }
+    }
 }
 
 @objc class KMThumbnailView: NSView {

+ 3 - 3
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/BookMarks/KMBookMarkViewController.swift

@@ -341,9 +341,9 @@ extension KMBookMarkViewController : NSTableViewDelegate,NSTableViewDataSource {
     }
     
     func tableViewSelectionDidChange(_ notification: Notification) {
-        if self.bookTableView.selectedRow == -1 {
-            self.cancelSelect()
-        }
+//        if self.bookTableView.selectedRow == -1 {
+//            self.cancelSelect()
+//        }
     }
     
     func selectIndex(index: Int) {

+ 3 - 3
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Outline/OutlineView/KMBOTAOutlineView.swift

@@ -235,9 +235,9 @@ extension KMBOTAOutlineView : NSOutlineViewDataSource,NSOutlineViewDelegate {
     }
     
     func outlineViewSelectionDidChange(_ notification: Notification) {
-        if self.outlineView.selectedRow == -1 {
-            self.cancelSelect()
-        }
+//        if self.outlineView.selectedRow == -1 {
+//            self.cancelSelect()
+//        }
     }
 }