فهرست منبع

【主页】最近文件列表点击页面空白处取消选中

lizhe 1 سال پیش
والد
کامیت
536653a128
1فایلهای تغییر یافته به همراه12 افزوده شده و 8 حذف شده
  1. 12 8
      PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift

+ 12 - 8
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift

@@ -737,11 +737,15 @@ extension KMHomeViewController {
             let x = eventPoint.x - 270.0
             if x >= 0 {
                 let point = NSPoint(x: x, y: eventPoint.y)
-                if historyFileViewController.historyFileCollectionView.frame.contains(point) ||
+                let historyPoint = historyFileViewController.historyFileCollectionView.convert(eventPoint, from: nil)
+                let indexPath = historyFileViewController.historyFileCollectionView.indexPathForItem(at: historyPoint)
+//                debugPrint(historyPoint)
+//                debugPrint(indexPath)
+                if  (historyFileViewController.historyFileCollectionView.frame.contains(point) ||
                     historyFileViewController.historyFileTableView.frame.contains(point) ||
                     historyFileViewController.deleteBox.frame.contains(point) ||
                     historyFileViewController.listBox.frame.contains(point) ||
-                    historyFileViewController.thumbnailBox.frame.contains(point) {
+                    historyFileViewController.thumbnailBox.frame.contains(point)) && indexPath != nil {
                     
                 } else {
                     self.historyFileViewController.selectFiles.removeAll()
@@ -1207,12 +1211,12 @@ extension KMHomeViewController {
     }
     
     @IBAction func escButtonAction(_ sender: Any) {
-        self.historyFileViewController.selectFiles.removeAll()
-        if self.historyFileViewController.showMode == .Thumbnail {
-            self.historyFileViewController.historyFileCollectionView.reloadData()
-        } else {
-            self.historyFileViewController.historyFileTableView.reloadData()
-        }
+//        self.historyFileViewController.selectFiles.removeAll()
+//        if self.historyFileViewController.showMode == .Thumbnail {
+//            self.historyFileViewController.historyFileCollectionView.reloadData()
+//        } else {
+//            self.historyFileViewController.historyFileTableView.reloadData()
+//        }
     }