Browse Source

Merge branch 'develop' of git.kdan.cc:Mac_PDF/PDF_Office into develop

tangchao 1 year ago
parent
commit
3aa5633fad

+ 5 - 1
PDF Office/PDF Master/Class/PDFTools/Print/Controller/KMPrintAccessoryController_OC.m

@@ -31,9 +31,12 @@
 
 - (void)setup {
     self.autoRotate = false;
-    self.printScalingMode = kPDFPrintPageScaleNone;
+    self.printScalingMode = kPDFPrintPageScaleToFit;
     [self reloadData];
     [self updateLanguage];
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        [self reloadData];
+    });
 }
 
 - (void)reloadData {
@@ -93,6 +96,7 @@
 }
 
 - (PDFPrintScalingMode)printScalingMode {
+    NSLog(@"%ld",(long)[[self valueForKeyPath:PRINTSCALINGMODE_KEYPATH] integerValue]);
     return [[self valueForKeyPath:PRINTSCALINGMODE_KEYPATH] integerValue];
 }
 

+ 2 - 3
PDF Office/PDF Master/Class/PDFTools/Print/Controller/KMPrintAccessoryController_OC.xib

@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Print/KMPrintWindowController.swift

@@ -213,7 +213,7 @@ class KMPrintWindowController: NSWindowController, NetServiceBrowserDelegate {
             document!.allowsPrinting == true) {
             let printInfo = NSPrintInfo.shared
             var printOperation: NSPrintOperation = NSPrintOperation()
-            let scalingMode: PDFPrintScalingMode = .pageScaleNone
+            let scalingMode: PDFPrintScalingMode = .pageScaleToFit
             if document!.responds(to: NSSelectorFromString("printOperationForPrintInfo:scalingMode:autoRotate:")) {
                 printOperation = document!.printOperation(for: printInfo, scalingMode: scalingMode, autoRotate: false)!
             }

+ 3 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/KMAnnotationViewController.swift

@@ -607,7 +607,9 @@ extension KMAnnotationViewController : NSMenuDelegate, NSMenuItemValidation {
         }
 
         menuItem = menu.addItem(withTitle: NSLocalizedString("Export Annotation", comment: ""), action: #selector(exportItemAction), target: self)
-        menuItem = menu.addItem(withTitle: NSLocalizedString("Import Annotation", comment: ""), action: #selector(importItemAction), target: self)
+        if self.annotationOutlineView.selectItems.count == 1 {
+            menuItem = menu.addItem(withTitle: NSLocalizedString("Import Annotation", comment: ""), action: #selector(importItemAction), target: self)
+        }
         menu.addItem(NSMenuItem.separator())
 
         menuItem = menu.addItem(withTitle: NSLocalizedString("Delete", comment: ""), action: #selector(deleteItemAction), target: self)

+ 2 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/KMThumbnailViewController.swift

@@ -616,7 +616,6 @@ class KMThumbnailViewController: NSViewController {
                 return
             }
             
-            
             var index = (self.thumbnailView.collectionView.selectionIndexes).last ?? -1
             if Int(index) >= 0 && self.copysPages.count > 0 {
                 var pageItems: [KMThumbnailPageItem] = []
@@ -629,6 +628,8 @@ class KMThumbnailViewController: NSViewController {
                 
                 self.selectPages(indexs: IndexSet(integer: index))
                 
+                self.listView.go(toPageIndex: index, animated: true)
+                
                 // 事件传递到外面
                 self.delegate?.controller?(controller: self, itemClick: menu, itemKey: .paste, params: nil)
             }

+ 10 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/Signature/KMSignatureWindowController.m

@@ -431,13 +431,15 @@ static KMSignatureWindowController *windowController_signature;
     [self inputButton_Click:nil];
     
     self.pictureHelpButton.image = [NSImage imageNamed:@"KMImageNameHelpNormal"];
+    self.pictureHelpButton.toolTip = @"Remove white background from images";
+    self.pictureHelpButton.action = @selector(showHelpTip:);
     self.pictureHelpButton.coverAction = ^(KMCoverButton * _Nonnull button, KMCoverAction action) {
         if (action == KMCoverActionEnter) {
             button.image = [NSImage imageNamed:@"KMImageNameHelpHover"];
-            [weakSelf showHelpTip:button];
+//            [weakSelf showHelpTip:button];
         } else if (action == KMCoverActionExit) {
             button.image = [NSImage imageNamed:@"KMImageNameHelpNormal"];
-            [weakSelf dismissHelpTip];
+//            [weakSelf dismissHelpTip];
         }
     };
     
@@ -565,6 +567,11 @@ static KMSignatureWindowController *windowController_signature;
     }
 }
 
+#pragma mark - mouse
+- (void)mouseDown:(NSEvent *)event {
+    [self dismissHelpTip];
+}
+
 #pragma mark - Private Methods
 
 -(void)localizedString
@@ -636,6 +643,7 @@ static KMSignatureWindowController *windowController_signature;
 
 - (void)showHelpTip:(NSButton *)sender {
     if (self.popover) {
+        [self dismissHelpTip];
         return;
     }