marinofaggiana 5 年 前
コミット
ea861766ae

+ 9 - 1
iOSClient/Main/Menu/NCDetailNavigationController+Menu.swift

@@ -73,7 +73,15 @@ extension NCDetailNavigationController {
         
         if #available(iOS 11.0, *) {
             if (metadata.typeFile == k_metadataTypeFile_document && metadata.contentType == "application/pdf" ) {
-                NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_menuSearchTextPDF), object: nil)
+                actions.append(
+                    NCMenuAction(title: NSLocalizedString("_search_", comment: ""),
+                        icon: CCGraphics.changeThemingColorImage(UIImage(named: "search"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
+                        action: { menuAction in
+                             NotificationCenter.default.post(name: Notification.Name.init(rawValue:
+                                               k_notificationCenter_menuSearchTextPDF), object: nil)
+                        }
+                    )
+                )
             }
         }
         

+ 1 - 6
iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift

@@ -126,12 +126,7 @@ import PDFKit
         viewerPDFSearch.pdfDocument = pdfDocument
         
         let navigaionController = UINavigationController.init(rootViewController: viewerPDFSearch)
-        
-//        if traitCollection.horizontalSizeClass == .regular {
-            
-//        } else {
-            appDelegate.activeDetail.present(navigaionController, animated: true)
-//        }
+        appDelegate.activeDetail.present(navigaionController, animated: true)
     }
     
     func searchPdfSelection(_ pdfSelection: PDFSelection) {