Browse Source

【综合】toolbar,搜索与BOTA联动

tangchao 1 year ago
parent
commit
0fb20317f1

+ 1 - 1
PDF Office/PDF Master.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -336,7 +336,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "3753"
             endingLineNumber = "3753"
-            landmarkName = "showTTSWindow()"
+            landmarkName = "toolbarViewController(_:itemDidClick:)"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>

+ 15 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Search.swift

@@ -7,6 +7,21 @@
 
 import Foundation
 
+// MARK: - Actions
+
+extension KMLeftSideViewController {
+    // 显示搜索模块
+    func showSearchMode(_ searchString: String = "") {
+        if self.leftView.segmentedControl.selectedSegment == 4 {
+            
+        } else {
+            self.leftView.segmentedControl.selectedSegment = 4
+        }
+        
+        self.searchViewController.searchField.stringValue = searchString
+    }
+}
+
 // MARK: - Menu
 
 extension KMLeftSideViewController {

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -3868,7 +3868,7 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
     }
     
     func toolbarViewController(_ viewController: KMToolbarViewController, searchAction searchString: String) {
-        Swift.debugPrint("Search Result " + searchString)
+        self.leftSideViewController.showSearchMode(searchString)
     }
 }