Эх сурвалжийг харах

add ViewerQuickLook

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 жил өмнө
parent
commit
ddb2df5aae

+ 1 - 1
Nextcloud.xcodeproj/project.pbxproj

@@ -4094,7 +4094,7 @@
 			isa = XCRemoteSwiftPackageReference;
 			repositoryURL = "https://github.com/marinofaggiana/Mantis";
 			requirement = {
-				branch = master;
+				branch = develop;
 				kind = branch;
 			};
 		};

+ 0 - 3
iOSClient/Main/Create cloud/NCUploadAssets.swift

@@ -333,9 +333,6 @@ struct UploadAssetsView: View {
                                             if item.asset.type == .photo || item.asset.type == .livePhoto {
                                                 presentedQuickLook(size: max(geo.size.height, geo.size.height), index: index)
                                             }
-                                        }
-                                        .onLongPressGesture {
-
                                         }
                                         .fullScreenCover(isPresented: $isPresentedQuickLook) {
                                             ViewerQuickLook(url: URL(fileURLWithPath: fileNamePath), index: $index, isPresentedQuickLook: $isPresentedQuickLook, uploadAssets: uploadAssets)

+ 17 - 1
iOSClient/Viewer/NCViewerQuickLook/ViewerQuickLook.swift

@@ -122,15 +122,31 @@ struct ViewerQuickLook: UIViewControllerRepresentable {
         @objc func crop() {
 
             guard let image = UIImage(contentsOfFile: parent.url.path) else { return }
-            let config = Mantis.Config()
 
+            var toolbarConfig = CropToolbarConfig()
+            toolbarConfig.heightForVerticalOrientation = 90
+            toolbarConfig.widthForHorizontalOrientation = 130
+            toolbarConfig.optionButtonFontSize = 16
+            toolbarConfig.optionButtonFontSizeForPad = 21
+            toolbarConfig.backgroundColor = .systemGray6
+            toolbarConfig.foregroundColor = .systemBlue
+
+            var viewConfig = CropViewConfig()
+            viewConfig.cropMaskVisualEffectType = .none
+            viewConfig.cropBorderColor = .red
+
+            var config = Mantis.Config()
             if let bundleIdentifier = Bundle.main.bundleIdentifier {
                 config.localizationConfig.bundle = Bundle(identifier: bundleIdentifier)
                 config.localizationConfig.tableName = "Localizable"
             }
+            config.cropToolbarConfig = toolbarConfig
+            config.cropViewConfig = viewConfig
+
             let cropViewController = Mantis.cropViewController(image: image, config: config)
 
             cropViewController.delegate = self
+            cropViewController.backgroundColor = .systemBackground
             cropViewController.modalPresentationStyle = .fullScreen
 
             viewController?.present(cropViewController, animated: true)