Просмотр исходного кода

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

tangchao 2 лет назад
Родитель
Сommit
681dc589d5
32 измененных файлов с 842 добавлено и 560 удалено
  1. 8 0
      PDF Office/PDF Office.xcodeproj/project.pbxproj
  2. 10 0
      PDF Office/PDF Office/AppDelegate.swift
  3. 1 10
      PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameLeftButtonImage.imageset/Contents.json
  4. 0 145
      PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameLeftButtonImage.imageset/icon btn.pdf
  5. 77 0
      PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameLeftButtonImage.imageset/style=back, state=norm.pdf
  6. 12 0
      PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameLeftButtonImageDis.imageset/Contents.json
  7. 77 0
      PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameLeftButtonImageDis.imageset/style=back, state=dis.pdf
  8. 1 10
      PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameRightButtonImage.imageset/Contents.json
  9. 0 145
      PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameRightButtonImage.imageset/icon btn.pdf
  10. 77 0
      PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameRightButtonImage.imageset/style=forward, state=norm.pdf
  11. 12 0
      PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameRightButtonImageDis.imageset/Contents.json
  12. 77 0
      PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameRightButtonImageDis.imageset/style=forward, state=dis.pdf
  13. 129 0
      PDF Office/PDF Office/Class/Home/Category/NSButton+DesignToken.swift
  14. 0 1
      PDF Office/PDF Office/Class/Home/ViewController/KMHomeViewController+Action.swift
  15. 61 55
      PDF Office/PDF Office/Class/Home/ViewController/customViewController/KMDesignBase.swift
  16. 71 70
      PDF Office/PDF Office/Class/Home/ViewController/customViewController/KMDesignButton.swift
  17. 23 3
      PDF Office/PDF Office/Class/Home/ViewController/customViewController/KMDesignPropertySelector.swift
  18. 1 0
      PDF Office/PDF Office/Class/Home/ViewController/customViewController/KMDesignSelect.swift
  19. 7 0
      PDF Office/PDF Office/Class/KMLightMember/Controller/AccountInfo/KMAccountInfoWindowController.swift
  20. 10 0
      PDF Office/PDF Office/Class/KMLightMember/Controller/Login&Register/KMLoginWindowController.swift
  21. 2 2
      PDF Office/PDF Office/Class/KMLightMember/Controller/VerificationCode/View/KMLightMemberAlertView.swift
  22. 1 1
      PDF Office/PDF Office/Class/KMLightMember/Controller/VerificationCode/View/KMVerificationCodeView.swift
  23. 4 4
      PDF Office/PDF Office/Class/KMLightMember/KMRequestServer/KMRequestServer.swift
  24. 16 2
      PDF Office/PDF Office/Class/KMLightMember/Manager/KMRequestServerManager.swift
  25. 52 41
      PDF Office/PDF Office/Class/PDFTools/Convert/Controller/KMConvertBaseWindowController.swift
  26. 65 63
      PDF Office/PDF Office/Class/PDFTools/Convert/Controller/KMConvertBaseWindowController.xib
  27. 9 0
      PDF Office/PDF Office/Class/PDFTools/Tools/KMBaseXibView/KMBaseXibView.swift
  28. 10 3
      PDF Office/PDF Office/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m
  29. 5 0
      PDF Office/PDF Office/Class/PDFWindowController/Toolbar/KMToolbarController.swift
  30. 10 1
      PDF Office/PDF Office/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift
  31. 6 1
      PDF Office/PDF Office/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift
  32. 8 3
      PDF Office/PDF Office/Class/PDFWindowController/ViewController/KMMainViewController.swift

+ 8 - 0
PDF Office/PDF Office.xcodeproj/project.pbxproj

@@ -833,6 +833,9 @@
 		9F81ADC229B87C7F002251F4 /* KMConvertPDFManagerOC.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F81ADC129B87C7F002251F4 /* KMConvertPDFManagerOC.m */; };
 		9F81ADC329B87C7F002251F4 /* KMConvertPDFManagerOC.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F81ADC129B87C7F002251F4 /* KMConvertPDFManagerOC.m */; };
 		9F81ADC429B87C7F002251F4 /* KMConvertPDFManagerOC.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F81ADC129B87C7F002251F4 /* KMConvertPDFManagerOC.m */; };
+		9F81ADC629B9B12C002251F4 /* NSButton+DesignToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F81ADC529B9B12C002251F4 /* NSButton+DesignToken.swift */; };
+		9F81ADC729B9B12C002251F4 /* NSButton+DesignToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F81ADC529B9B12C002251F4 /* NSButton+DesignToken.swift */; };
+		9F81ADC829B9B12C002251F4 /* NSButton+DesignToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F81ADC529B9B12C002251F4 /* NSButton+DesignToken.swift */; };
 		9F8539BE2943085A00DF644E /* KMBrowser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8539BD2943085A00DF644E /* KMBrowser.swift */; };
 		9F8539BF2943085A00DF644E /* KMBrowser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8539BD2943085A00DF644E /* KMBrowser.swift */; };
 		9F8539C02943085A00DF644E /* KMBrowser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8539BD2943085A00DF644E /* KMBrowser.swift */; };
@@ -3398,6 +3401,7 @@
 		9F78EFC528F7E965001E66F4 /* KMHomeViewController+UI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "KMHomeViewController+UI.swift"; sourceTree = "<group>"; };
 		9F81ADC029B87C7F002251F4 /* KMConvertPDFManagerOC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KMConvertPDFManagerOC.h; sourceTree = "<group>"; };
 		9F81ADC129B87C7F002251F4 /* KMConvertPDFManagerOC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KMConvertPDFManagerOC.m; sourceTree = "<group>"; };
+		9F81ADC529B9B12C002251F4 /* NSButton+DesignToken.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSButton+DesignToken.swift"; sourceTree = "<group>"; };
 		9F8539BD2943085A00DF644E /* KMBrowser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMBrowser.swift; sourceTree = "<group>"; };
 		9F8539C529430AC400DF644E /* KMToolbarRightView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMToolbarRightView.swift; sourceTree = "<group>"; };
 		9F8539C929430BF300DF644E /* KMBrowserWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMBrowserWindowController.swift; sourceTree = "<group>"; };
@@ -5228,6 +5232,7 @@
 				9F0CB4C3298625F400007028 /* NSColor+KMExtensions.swift */,
 				9FBC48BE299E23B100CA39D7 /* NSViewController+DesignToken.swift */,
 				9F3D818D29A22AD90087B5AD /* Date+KMExtensions.swift */,
+				9F81ADC529B9B12C002251F4 /* NSButton+DesignToken.swift */,
 			);
 			path = Category;
 			sourceTree = "<group>";
@@ -9151,6 +9156,7 @@
 				BB146FDE299DC0D100784A6A /* GTLRDriveObjects.m in Sources */,
 				9F0CB5112986565700007028 /* KMDesignToken+BorderRadius.swift in Sources */,
 				F34BF949295310AB002C25A2 /* NSUserDefaults+PDFListView.m in Sources */,
+				9F81ADC629B9B12C002251F4 /* NSButton+DesignToken.swift in Sources */,
 				BBEC00C7295C319400A26C98 /* KMBatesManager.swift in Sources */,
 				BB147020299DC0D100784A6A /* OIDServiceDiscovery.m in Sources */,
 				BB5DF1F12959C9F00025CDA1 /* KMHeaderFooterPropertyMainController.swift in Sources */,
@@ -9860,6 +9866,7 @@
 				BB146FDF299DC0D100784A6A /* GTLRDriveObjects.m in Sources */,
 				9F0CB5122986565700007028 /* KMDesignToken+BorderRadius.swift in Sources */,
 				BB86C1EE28F544F4005AD968 /* CPDFListView+Event.m in Sources */,
+				9F81ADC729B9B12C002251F4 /* NSButton+DesignToken.swift in Sources */,
 				BBEC00C8295C319400A26C98 /* KMBatesManager.swift in Sources */,
 				BB147021299DC0D100784A6A /* OIDServiceDiscovery.m in Sources */,
 				BB5DF1F22959C9F00025CDA1 /* KMHeaderFooterPropertyMainController.swift in Sources */,
@@ -10858,6 +10865,7 @@
 				BBD1F77E296F9BE000343885 /* KMPageEditSettingBaseWindowController.swift in Sources */,
 				9F080B25298FCB0D00FC27DA /* KMDesignToken+Action.swift in Sources */,
 				89E93EE02999DA6D00F10F66 /* KMNoteFilterCollevtionViewItem.m in Sources */,
+				9F81ADC829B9B12C002251F4 /* NSButton+DesignToken.swift in Sources */,
 				BB146FB9299DC0D100784A6A /* GTLRRuntimeCommon.m in Sources */,
 				BB147013299DC0D100784A6A /* OIDError.m in Sources */,
 				9F0CB4BF2977C06300007028 /* KMPropertiesPanelColorSubVC.swift in Sources */,

+ 10 - 0
PDF Office/PDF Office/AppDelegate.swift

@@ -41,6 +41,16 @@ class AppDelegate: NSObject, NSApplicationDelegate {
 //        测试模式,默认false
         KMAdvertisementManager.manager.debug = true
         
+        //第一次开启app
+        var info = UserDefaults.standard.value(forKey: "kFirstOpenAppCount")
+        var count = 0
+        if info != nil {
+            count = info as? Int ?? 0
+        }
+        count += 1
+        UserDefaults.standard.set(count, forKey: "kFirstOpenAppCount")
+        UserDefaults.standard.synchronize()
+        
         self.initMainMenu()
         /// pro
 //    [DBClientsManager setupWithAppKeyDesktop:@"amipzwtlg9lrwyl"];

+ 1 - 10
PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameLeftButtonImage.imageset/Contents.json

@@ -1,16 +1,7 @@
 {
   "images" : [
     {
-      "filename" : "icon btn.pdf",
-      "idiom" : "universal"
-    },
-    {
-      "appearances" : [
-        {
-          "appearance" : "luminosity",
-          "value" : "dark"
-        }
-      ],
+      "filename" : "style=back, state=norm.pdf",
       "idiom" : "universal"
     }
   ],

+ 0 - 145
PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameLeftButtonImage.imageset/icon btn.pdf

@@ -1,145 +0,0 @@
-%PDF-1.7
-
-1 0 obj
-  << >>
-endobj
-
-2 0 obj
-  << /Length 3 0 R >>
-stream
-/DeviceRGB CS
-/DeviceRGB cs
-q
-0.000000 20.000000 m
-0.000000 22.209139 1.790861 24.000000 4.000000 24.000000 c
-20.000000 24.000000 l
-22.209139 24.000000 24.000000 22.209139 24.000000 20.000000 c
-24.000000 4.000000 l
-24.000000 1.790861 22.209139 0.000000 20.000000 0.000000 c
-4.000000 0.000000 l
-1.790861 0.000000 0.000000 1.790861 0.000000 4.000000 c
-0.000000 20.000000 l
-h
-W*
-n
-q
-1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
-0.874510 0.882353 0.898039 scn
-4.000000 23.000000 m
-20.000000 23.000000 l
-20.000000 25.000000 l
-4.000000 25.000000 l
-4.000000 23.000000 l
-h
-23.000000 20.000000 m
-23.000000 4.000000 l
-25.000000 4.000000 l
-25.000000 20.000000 l
-23.000000 20.000000 l
-h
-20.000000 1.000000 m
-4.000000 1.000000 l
-4.000000 -1.000000 l
-20.000000 -1.000000 l
-20.000000 1.000000 l
-h
-1.000000 4.000000 m
-1.000000 20.000000 l
--1.000000 20.000000 l
--1.000000 4.000000 l
-1.000000 4.000000 l
-h
-4.000000 1.000000 m
-2.343146 1.000000 1.000000 2.343145 1.000000 4.000000 c
--1.000000 4.000000 l
--1.000000 1.238577 1.238577 -1.000000 4.000000 -1.000000 c
-4.000000 1.000000 l
-h
-23.000000 4.000000 m
-23.000000 2.343145 21.656855 1.000000 20.000000 1.000000 c
-20.000000 -1.000000 l
-22.761423 -1.000000 25.000000 1.238577 25.000000 4.000000 c
-23.000000 4.000000 l
-h
-20.000000 23.000000 m
-21.656855 23.000000 23.000000 21.656855 23.000000 20.000000 c
-25.000000 20.000000 l
-25.000000 22.761423 22.761423 25.000000 20.000000 25.000000 c
-20.000000 23.000000 l
-h
-4.000000 25.000000 m
-1.238576 25.000000 -1.000000 22.761423 -1.000000 20.000000 c
-1.000000 20.000000 l
-1.000000 21.656855 2.343146 23.000000 4.000000 23.000000 c
-4.000000 25.000000 l
-h
-f
-n
-Q
-Q
-q
-1.000000 0.000000 -0.000000 1.000000 5.050049 7.869873 cm
-0.380392 0.392157 0.411765 scn
-2.560660 4.880192 m
-4.880306 7.199838 l
-3.819645 8.260498 l
-0.219670 4.660522 l
--0.073223 4.367630 -0.073223 3.892756 0.219670 3.599863 c
-3.819645 -0.000113 l
-4.880306 1.060547 l
-2.560661 3.380192 l
-13.949975 3.380192 l
-13.949975 4.880192 l
-2.560660 4.880192 l
-h
-f*
-n
-Q
-
-endstream
-endobj
-
-3 0 obj
-  2010
-endobj
-
-4 0 obj
-  << /Annots []
-     /Type /Page
-     /MediaBox [ 0.000000 0.000000 24.000000 24.000000 ]
-     /Resources 1 0 R
-     /Contents 2 0 R
-     /Parent 5 0 R
-  >>
-endobj
-
-5 0 obj
-  << /Kids [ 4 0 R ]
-     /Count 1
-     /Type /Pages
-  >>
-endobj
-
-6 0 obj
-  << /Pages 5 0 R
-     /Type /Catalog
-  >>
-endobj
-
-xref
-0 7
-0000000000 65535 f
-0000000010 00000 n
-0000000034 00000 n
-0000002100 00000 n
-0000002123 00000 n
-0000002296 00000 n
-0000002370 00000 n
-trailer
-<< /ID [ (some) (id) ]
-   /Root 6 0 R
-   /Size 7
->>
-startxref
-2429
-%%EOF

+ 77 - 0
PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameLeftButtonImage.imageset/style=back, state=norm.pdf

@@ -0,0 +1,77 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 1.050049 3.869705 cm
+0.380392 0.392157 0.411765 scn
+2.560660 4.880299 m
+4.880306 7.199944 l
+3.819645 8.260605 l
+0.219670 4.660629 l
+-0.073223 4.367736 -0.073223 3.892863 0.219670 3.599969 c
+3.819645 -0.000006 l
+4.880306 1.060654 l
+2.560661 3.380299 l
+13.949975 3.380299 l
+13.949975 4.880299 l
+2.560660 4.880299 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  389
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 16.000000 16.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000479 00000 n
+0000000501 00000 n
+0000000674 00000 n
+0000000748 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+807
+%%EOF

+ 12 - 0
PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameLeftButtonImageDis.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "style=back, state=dis.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 77 - 0
PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameLeftButtonImageDis.imageset/style=back, state=dis.pdf

@@ -0,0 +1,77 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 1.050049 3.869705 cm
+0.694118 0.701961 0.721569 scn
+2.560660 4.880299 m
+4.880306 7.199944 l
+3.819645 8.260605 l
+0.219670 4.660629 l
+-0.073223 4.367736 -0.073223 3.892863 0.219670 3.599969 c
+3.819645 -0.000006 l
+4.880306 1.060654 l
+2.560661 3.380299 l
+13.949975 3.380299 l
+13.949975 4.880299 l
+2.560660 4.880299 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  389
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 16.000000 16.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000479 00000 n
+0000000501 00000 n
+0000000674 00000 n
+0000000748 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+807
+%%EOF

+ 1 - 10
PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameRightButtonImage.imageset/Contents.json

@@ -1,16 +1,7 @@
 {
   "images" : [
     {
-      "filename" : "icon btn.pdf",
-      "idiom" : "universal"
-    },
-    {
-      "appearances" : [
-        {
-          "appearance" : "luminosity",
-          "value" : "dark"
-        }
-      ],
+      "filename" : "style=forward, state=norm.pdf",
       "idiom" : "universal"
     }
   ],

+ 0 - 145
PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameRightButtonImage.imageset/icon btn.pdf

@@ -1,145 +0,0 @@
-%PDF-1.7
-
-1 0 obj
-  << >>
-endobj
-
-2 0 obj
-  << /Length 3 0 R >>
-stream
-/DeviceRGB CS
-/DeviceRGB cs
-q
-0.000000 20.000000 m
-0.000000 22.209139 1.790861 24.000000 4.000000 24.000000 c
-20.000000 24.000000 l
-22.209139 24.000000 24.000000 22.209139 24.000000 20.000000 c
-24.000000 4.000000 l
-24.000000 1.790861 22.209139 0.000000 20.000000 0.000000 c
-4.000000 0.000000 l
-1.790861 0.000000 0.000000 1.790861 0.000000 4.000000 c
-0.000000 20.000000 l
-h
-W*
-n
-q
-1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
-0.874510 0.882353 0.898039 scn
-4.000000 23.000000 m
-20.000000 23.000000 l
-20.000000 25.000000 l
-4.000000 25.000000 l
-4.000000 23.000000 l
-h
-23.000000 20.000000 m
-23.000000 4.000000 l
-25.000000 4.000000 l
-25.000000 20.000000 l
-23.000000 20.000000 l
-h
-20.000000 1.000000 m
-4.000000 1.000000 l
-4.000000 -1.000000 l
-20.000000 -1.000000 l
-20.000000 1.000000 l
-h
-1.000000 4.000000 m
-1.000000 20.000000 l
--1.000000 20.000000 l
--1.000000 4.000000 l
-1.000000 4.000000 l
-h
-4.000000 1.000000 m
-2.343146 1.000000 1.000000 2.343145 1.000000 4.000000 c
--1.000000 4.000000 l
--1.000000 1.238577 1.238577 -1.000000 4.000000 -1.000000 c
-4.000000 1.000000 l
-h
-23.000000 4.000000 m
-23.000000 2.343145 21.656855 1.000000 20.000000 1.000000 c
-20.000000 -1.000000 l
-22.761423 -1.000000 25.000000 1.238577 25.000000 4.000000 c
-23.000000 4.000000 l
-h
-20.000000 23.000000 m
-21.656855 23.000000 23.000000 21.656855 23.000000 20.000000 c
-25.000000 20.000000 l
-25.000000 22.761423 22.761423 25.000000 20.000000 25.000000 c
-20.000000 23.000000 l
-h
-4.000000 25.000000 m
-1.238576 25.000000 -1.000000 22.761423 -1.000000 20.000000 c
-1.000000 20.000000 l
-1.000000 21.656855 2.343146 23.000000 4.000000 23.000000 c
-4.000000 25.000000 l
-h
-f
-n
-Q
-Q
-q
-1.000000 0.000000 -0.000000 1.000000 5.000000 7.869873 cm
-0.380392 0.392157 0.411765 scn
-11.389303 4.880205 m
-0.000000 4.880206 l
-0.000000 3.380206 l
-11.389328 3.380205 l
-9.069671 1.060547 l
-10.130330 -0.000113 l
-13.730306 3.599863 l
-14.023199 3.892756 14.023199 4.367629 13.730306 4.660522 c
-10.130330 8.260498 l
-9.069671 7.199838 l
-11.389303 4.880205 l
-h
-f*
-n
-Q
-
-endstream
-endobj
-
-3 0 obj
-  2015
-endobj
-
-4 0 obj
-  << /Annots []
-     /Type /Page
-     /MediaBox [ 0.000000 0.000000 24.000000 24.000000 ]
-     /Resources 1 0 R
-     /Contents 2 0 R
-     /Parent 5 0 R
-  >>
-endobj
-
-5 0 obj
-  << /Kids [ 4 0 R ]
-     /Count 1
-     /Type /Pages
-  >>
-endobj
-
-6 0 obj
-  << /Pages 5 0 R
-     /Type /Catalog
-  >>
-endobj
-
-xref
-0 7
-0000000000 65535 f
-0000000010 00000 n
-0000000034 00000 n
-0000002105 00000 n
-0000002128 00000 n
-0000002301 00000 n
-0000002375 00000 n
-trailer
-<< /ID [ (some) (id) ]
-   /Root 6 0 R
-   /Size 7
->>
-startxref
-2434
-%%EOF

+ 77 - 0
PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameRightButtonImage.imageset/style=forward, state=norm.pdf

@@ -0,0 +1,77 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 1.000000 3.869690 cm
+0.380392 0.392157 0.411765 scn
+11.389303 4.880312 m
+0.000000 4.880313 l
+0.000000 3.380313 l
+11.389328 3.380312 l
+9.069671 1.060654 l
+10.130330 -0.000006 l
+13.730306 3.599969 l
+14.023199 3.892862 14.023199 4.367736 13.730306 4.660629 c
+10.130330 8.260605 l
+9.069671 7.199944 l
+11.389303 4.880312 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  394
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 16.000000 16.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000484 00000 n
+0000000506 00000 n
+0000000679 00000 n
+0000000753 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+812
+%%EOF

+ 12 - 0
PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameRightButtonImageDis.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "style=forward, state=dis.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 77 - 0
PDF Office/PDF Office/Class/Appearance/Image.xcassets/PDF Tools/KMImageNameRightButtonImageDis.imageset/style=forward, state=dis.pdf

@@ -0,0 +1,77 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 1.000000 3.869690 cm
+0.694118 0.701961 0.721569 scn
+11.389303 4.880312 m
+0.000000 4.880313 l
+0.000000 3.380313 l
+11.389328 3.380312 l
+9.069671 1.060654 l
+10.130330 -0.000006 l
+13.730306 3.599969 l
+14.023199 3.892862 14.023199 4.367736 13.730306 4.660629 c
+10.130330 8.260605 l
+9.069671 7.199944 l
+11.389303 4.880312 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  394
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 16.000000 16.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000484 00000 n
+0000000506 00000 n
+0000000679 00000 n
+0000000753 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+812
+%%EOF

+ 129 - 0
PDF Office/PDF Office/Class/Home/Category/NSButton+DesignToken.swift

@@ -0,0 +1,129 @@
+//
+//  NSButton+DesignToken.swift
+//  PDF Office
+//
+//  Created by wanjun on 2023/3/9.
+//
+
+import Foundation
+
+extension NSButton {
+    func designToken(bgToken: String = "", textToken: String = "", heightConstraint: NSLayoutConstraint = NSLayoutConstraint(), state: KMDesignTokenState = .Norm) -> Void {
+        self.isBordered = false
+        self.wantsLayer = true
+
+        let designToken = KMDesignToken.shared
+        
+        var height: String?
+        var horizontalPadding: String?
+        var borderColor: NSColor?
+        var borderRadius: String?
+        var borderWidth: String?
+        var itemSpacing: String?
+        var fill: NSColor?
+        var textTypography: KMTypographyValue?
+        var textFill: NSColor?
+        
+        if bgToken != "" {
+            height = designToken.height(withToken: bgToken)
+            horizontalPadding = designToken.horizontalPadding(withToken: bgToken)
+            borderColor = designToken.border(withToken: bgToken)
+            borderRadius = designToken.borderRadius(withToken: bgToken)
+            borderWidth = designToken.borderWidth(withToken: bgToken)
+            itemSpacing = designToken.itemSpacing(withToken: bgToken)
+            fill = designToken.fill(withToken: bgToken)
+        }
+        if textToken != "" {
+            textTypography = designToken.typography(withToken: textToken)
+            textFill = designToken.fill(withToken: textToken)
+        }
+
+        if heightConstraint != nil {
+            if heightConstraint.shouldBeArchived {
+                heightConstraint.constant = height!.stringToCGFloat()
+            }
+        }
+        if itemSpacing != nil {}
+        if horizontalPadding != nil {}
+//        if textTypography != nil {
+//            var fontFamily: String = textTypography!.fontFamily
+//            let fontWeight: String = textTypography!.fontWeight
+//            if fontFamily.contains(" ") {
+//                fontFamily = fontFamily.replacingOccurrences(of: " ", with: "")
+//            }
+//            if fontWeight != "" {
+//                fontFamily = String(format: "%@-%@", fontFamily,fontWeight)
+//            }
+//            if state == .Norm {
+//                control.font = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
+//                control.lineHeight = textTypography!.lineHeight.stringToCGFloat()
+//            } else if (state == .Hov) {
+//                control.font_hov = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
+//                control.lineHeight_hov = textTypography!.lineHeight.stringToCGFloat()
+//            } else if (state == .Act) {
+//                control.font_act = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
+//                control.lineHeight_act = textTypography!.lineHeight.stringToCGFloat()
+//            } else if (state == .Disabled) {
+//                control.font_disabled = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
+//                control.lineHeight_disabled = textTypography!.lineHeight.stringToCGFloat()
+//            }
+//        }
+//        if fill != nil {
+//            if state == .Norm {
+//                control.background = fill!
+//            } else if (state == .Hov) {
+//                control.background_hov = fill!
+//            } else if (state == .Act) {
+//                control.background_act = fill!
+//            } else if (state == .Disabled) {
+//                control.background_disabled = fill!
+//            }
+//        }
+//        if textFill != nil {
+//            if state == .Norm {
+//                control.textColor = textFill!
+//            } else if (state == .Hov) {
+//                control.textColor_hov = textFill!
+//            } else if (state == .Act) {
+//                control.textColor_act = textFill!
+//            } else if (state == .Disabled) {
+//                control.textColor_disabled = textFill!
+//            }
+//        }
+//        if borderRadius != nil {
+//            if state == .Norm {
+//                control.cornerRadius =
+//                self.layer?.cornerRadius = borderRadius!.stringToCGFloat()
+//            } else if (state == .Hov) {
+//                control.cornerRadius_hov = Float(borderRadius!.stringToCGFloat())
+//            } else if (state == .Act) {
+//                control.cornerRadius_act = Float(borderRadius!.stringToCGFloat())
+//            } else if (state == .Disabled) {
+//                control.cornerRadius_disabled = Float(borderRadius!.stringToCGFloat())
+//            }
+//        }
+//        if borderWidth != nil {
+//            if state == .Norm {
+//                control.borderWidth = Float(borderWidth!.stringToCGFloat())
+//            } else if (state == .Hov) {
+//                control.borderWidth_hov = Float(borderWidth!.stringToCGFloat())
+//            } else if (state == .Act) {
+//                control.borderWidth_act = Float(borderWidth!.stringToCGFloat())
+//            } else if (state == .Disabled) {
+//                control.borderWidth_disabled = Float(borderWidth!.stringToCGFloat())
+//            }
+//        }
+//        if borderWidth != nil {
+//            if state == .Norm {
+//                control.borderColor = borderColor!
+//            } else if (state == .Hov) {
+//                control.borderColor_hov = borderColor!
+//            } else if (state == .Act) {
+//                control.borderColor_act = borderColor!
+//            } else if (state == .Disabled) {
+//                control.borderColor_disabled = borderColor!
+//            }
+//        }
+
+    }
+}

+ 0 - 1
PDF Office/PDF Office/Class/Home/ViewController/KMHomeViewController+Action.swift

@@ -412,7 +412,6 @@ extension KMHomeViewController {
             let savePath = fetchUniquePath(fileName.kUrlToPDFFolderPath())
             openOfficeFile(url: path)
         }
-
     }
     
     func openImageFile(url: URL) -> Void {

+ 61 - 55
PDF Office/PDF Office/Class/Home/ViewController/customViewController/KMDesignBase.swift

@@ -9,66 +9,73 @@ import Cocoa
 
 class KMDesignBase: NSViewController {
     
-    var borderColor: NSColor = .clear// 边框颜色
-    var borderColor_hov: NSColor = .clear// 边框颜色
-    var borderColor_sel: NSColor = .clear// 边框颜色
-    var borderColor_focus: NSColor = .clear// 边框颜色
-    var borderColor_disabled: NSColor = .clear// 边框颜色
-    var borderColor_errordef: NSColor = .clear// 边框颜色
-    var borderColor_errorfocus: NSColor = .clear// 边框颜色
-    var cornerRadius: Float = 0.0// 边框圆角
-    var cornerRadius_hov: Float = 0.0// 边框圆角
-    var cornerRadius_sel: Float = 0.0// 边框圆角
-    var cornerRadius_focus: Float = 0.0// 边框圆角
-    var cornerRadius_disabled: Float = 0.0// 边框圆角
-    var cornerRadius_errordef: Float = 0.0// 边框圆角
-    var cornerRadius_errorfocus: Float = 0.0// 边框圆角
-    var borderWidth: Float = 1.0// 边框宽度
-    var borderWidth_hov: Float = 1.0// 边框宽度
-    var borderWidth_sel: Float = 1.0// 边框宽度
-    var borderWidth_focus: Float = 1.0// 边框宽度
-    var borderWidth_disabled: Float = 1.0// 边框宽度
-    var borderWidth_errordef: Float = 1.0// 边框宽度
-    var borderWidth_errorfocus: Float = 1.0// 边框宽度
-    var background: NSColor = .clear// 背景颜色
-    var background_hov: NSColor = .clear// 背景颜色
-    var background_sel: NSColor = .clear// 背景颜色
-    var background_focus: NSColor = .clear// 背景颜色
-    var background_disabled: NSColor = .clear// 背景颜色
-    var background_errordef: NSColor = .clear// 背景颜色
-    var background_errorfocus: NSColor = .clear// 背景颜色
-    var textColor: NSColor = .black // 内容颜色
-    var textColor_hov: NSColor = .black // 内容颜色
-    var textColor_sel: NSColor = .black // 内容颜色
-    var textColor_focus: NSColor = .black // 内容颜色
-    var textColor_disabled: NSColor = .black // 内容颜色
-    var textColor_errordef: NSColor = .black // 内容颜色
-    var textColor_errorfocus: NSColor = .black // 内容颜色
-    var lineHeight: CGFloat = 20.0 // 默认 内容行高
-    var lineHeight_hov: CGFloat = 20.0 // 默认 内容行高
-    var lineHeight_sel: CGFloat = 20.0 // 默认 内容行高
-    var lineHeight_focus: CGFloat = 20.0 // 默认 内容行高
-    var lineHeight_disabled: CGFloat = 20.0 // 默认 内容行高
-    var lineHeight_errordef: CGFloat = 20.0 // 默认 内容行高
-    var lineHeight_errorfocus: CGFloat = 20.0 // 默认 内容行高
-    var font: NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
-    var font_hov: NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
-    var font_sel: NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
-    var font_focus: NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
-    var font_disabled: NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
-    var font_errordef: NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
-    var font_errorfocus: NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
+    var borderColor             : NSColor = .clear // 边框颜色
+    var borderColor_hov         : NSColor = .clear // 边框颜色
+    var borderColor_sel         : NSColor = .clear // 边框颜色
+    var background_act          : NSColor = .clear // 背景颜色
+    var borderColor_focus       : NSColor = .clear // 边框颜色
+    var borderColor_act         : NSColor = .clear // 边框颜色
+    var borderColor_disabled    : NSColor = .clear // 边框颜色
+    var borderColor_errordef    : NSColor = .clear // 边框颜色
+    var borderColor_errorfocus  : NSColor = .clear // 边框颜色
+    var cornerRadius            : Float = 0.0 // 边框圆角
+    var cornerRadius_hov        : Float = 0.0 // 边框圆角
+    var cornerRadius_sel        : Float = 0.0 // 边框圆角
+    var cornerRadius_act        : Float = 0.0 // 边框圆角
+    var cornerRadius_focus      : Float = 0.0 // 边框圆角
+    var cornerRadius_disabled   : Float = 0.0 // 边框圆角
+    var cornerRadius_errordef   : Float = 0.0 // 边框圆角
+    var cornerRadius_errorfocus : Float = 0.0 // 边框圆角
+    var borderWidth             : Float = 1.0 // 边框宽度
+    var borderWidth_hov         : Float = 1.0 // 边框宽度
+    var borderWidth_sel         : Float = 1.0 // 边框宽度
+    var borderWidth_act         : Float = 1.0 // 边框宽度
+    var borderWidth_focus       : Float = 1.0 // 边框宽度
+    var borderWidth_disabled    : Float = 1.0 // 边框宽度
+    var borderWidth_errordef    : Float = 1.0 // 边框宽度
+    var borderWidth_errorfocus  : Float = 1.0 // 边框宽度
+    var background              : NSColor = .clear // 背景颜色
+    var background_hov          : NSColor = .clear // 背景颜色
+    var background_sel          : NSColor = .clear // 背景颜色
+    var background_focus        : NSColor = .clear // 背景颜色
+    var background_disabled     : NSColor = .clear // 背景颜色
+    var background_errordef     : NSColor = .clear // 背景颜色
+    var background_errorfocus   : NSColor = .clear // 背景颜色
+    var textColor               : NSColor = .black // 内容颜色
+    var textColor_hov           : NSColor = .black // 内容颜色
+    var textColor_sel           : NSColor = .black // 内容颜色
+    var textColor_act           : NSColor = .black // 内容颜色
+    var textColor_focus         : NSColor = .black // 内容颜色
+    var textColor_disabled      : NSColor = .black // 内容颜色
+    var textColor_errordef      : NSColor = .black // 内容颜色
+    var textColor_errorfocus    : NSColor = .black // 内容颜色
+    var lineHeight              : CGFloat = 20.0 // 默认 内容行高
+    var lineHeight_hov          : CGFloat = 20.0 // 默认 内容行高
+    var lineHeight_sel          : CGFloat = 20.0 // 默认 内容行高
+    var lineHeight_act          : CGFloat = 20.0 // 默认 内容行高
+    var lineHeight_focus        : CGFloat = 20.0 // 默认 内容行高
+    var lineHeight_disabled     : CGFloat = 20.0 // 默认 内容行高
+    var lineHeight_errordef     : CGFloat = 20.0 // 默认 内容行高
+    var lineHeight_errorfocus   : CGFloat = 20.0 // 默认 内容行高
+    var font            : NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
+    var font_hov        : NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
+    var font_sel        : NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
+    var font_act        : NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
+    var font_focus      : NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
+    var font_disabled   : NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
+    var font_errordef   : NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
+    var font_errorfocus : NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
     
     var stringValue: String = ""// 内容
-    var toolTip: String = "" // 提示文字
+    var _toolTip: String = "" // 提示文字
 
     // button 通用属性
-    var action: Selector?   // 点击事件
-    var target: AnyObject? // 对象目标
-    var enabled: Bool = true // 是否可点击
+    var _action: Selector?   // 点击事件
+    var _target: AnyObject? // 对象目标
+    var _enabled: Bool = true // 是否可点击
     var _state: KMDesignTokenState = .Norm
     var canHover: Bool = true // 是否可悬浮
-    var isHidden: Bool = false // 是否隐藏
+    var _isHidden: Bool = false // 是否隐藏
     var editable: Bool = false //是否允许编辑
 
     var buttonType: DesignButtonType = .Text
@@ -77,5 +84,4 @@ class KMDesignBase: NSViewController {
         super.viewDidLoad()
         // Do view setup here.
     }
-    
 }

+ 71 - 70
PDF Office/PDF Office/Class/Home/ViewController/customViewController/KMDesignButton.swift

@@ -14,7 +14,7 @@ import Cocoa
     case PopUpButton
 }
 
-class KMDesignButton: NSViewController {
+class KMDesignButton: KMDesignBase {
     
     @IBOutlet weak var mainBox: NSBox!
     @IBOutlet weak var button   : NSButton!
@@ -72,48 +72,7 @@ class KMDesignButton: NSViewController {
     var textImage_paddingSpacing: Float = 16.0
     var textImage_itemSpacing: Float = 8.0
 
-    var textColor: NSColor = .black // 内容颜色
-    var textColor_hov: NSColor = .black // 内容颜色
-    var textColor_act: NSColor = .black // 内容颜色
-    var textColor_disabled: NSColor = .black // 内容颜色
-    var background: NSColor = .clear// 背景颜色
-    var background_hov: NSColor = .clear// 背景颜色
-    var background_act: NSColor = .clear// 背景颜色
-    var background_disabled: NSColor = .clear// 背景颜色
-    var borderWidth: Float = 1.0// 边框宽度
-    var borderWidth_hov: Float = 1.0// 边框宽度
-    var borderWidth_act: Float = 1.0// 边框宽度
-    var borderWidth_disabled: Float = 1.0// 边框宽度
-    var borderColor: NSColor = .clear// 边框颜色
-    var borderColor_hov: NSColor = .clear// 边框颜色
-    var borderColor_act: NSColor = .clear// 边框颜色
-    var borderColor_disabled: NSColor = .clear// 边框颜色
-    var cornerRadius: Float = 0.0// 边框圆角
-    var cornerRadius_hov: Float = 0.0// 边框圆角
-    var cornerRadius_act: Float = 0.0// 边框圆角
-    var cornerRadius_disabled: Float = 0.0// 边框圆角
-    var lineHeight: CGFloat = 20.0 // 默认 内容行高
-    var lineHeight_hov: CGFloat = 20.0 // 默认 内容行高
-    var lineHeight_act: CGFloat = 20.0 // 默认 内容行高
-    var lineHeight_disabled: CGFloat = 20.0 // 默认 内容行高
-    var font: NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
-    var font_hov: NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
-    var font_act: NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
-    var font_disabled: NSFont = NSFont.systemFont(ofSize: 14.0) // 内容字体
-
-    var stringValue: String = ""// 内容
-    var toolTip: String = "" // 提示文字
-
     // button 通用属性
-    var action: Selector?   // 点击事件
-    var target: AnyObject? // 对象目标
-    var enabled: Bool = true // 是否可点击
-    var state: KMDesignTokenState = .Norm
-    var canHover: Bool = true // 是否可悬浮
-    var isHidden: Bool = false // 是否隐藏
-    var editable: Bool = false //是否允许编辑
-
-    var buttonType: DesignButtonType = .Text
     var textImage_type: KMTextImageButtonType = .Left
     var textImage_state: KMDesignTokenState = .Norm
     
@@ -183,6 +142,60 @@ class KMDesignButton: NSViewController {
     }
     
     // MARK: Get、Set
+    
+    var action: Selector {
+        get {
+            return _action!
+        }
+        set {
+            _action = newValue
+            if _action != nil {
+                button.action = _action
+            }
+        }
+    }
+    
+    var target: AnyObject {
+        get {
+            return _target!
+        }
+        set {
+            _target = newValue
+            if _target != nil {
+                button.target = _target
+            }
+        }
+    }
+    
+    var state: KMDesignTokenState {
+        get {
+            return _state
+        }
+        set {
+            _state = newValue
+            updateUI()
+        }
+    }
+    
+    var enabled: Bool {
+        get {
+            return _enabled
+        }
+        set {
+            _enabled = newValue
+            self.view.isHidden = _enabled
+        }
+    }
+    
+    var isHidden: Bool {
+        get {
+            return _isHidden
+        }
+        set {
+            _isHidden = newValue
+            button.isEnabled = _enabled
+        }
+    }
 
     var image: NSImage {
         get {
@@ -207,6 +220,18 @@ class KMDesignButton: NSViewController {
         }
     }
     
+    var toolTip: String {
+        get {
+            return _toolTip
+        }
+        set {
+            _toolTip = newValue
+            if _toolTip != "" {
+                button.toolTip = _toolTip
+            }
+        }
+    }
+    
     // MARK: Private Methods
 
     func updateUI() -> Void {
@@ -245,16 +270,7 @@ class KMDesignButton: NSViewController {
                 textButtonlabel.font = font_disabled
                 paragraphStyle.lineSpacing = lineHeight_disabled
             }
-            if action != nil {
-                button.action = action
-                button.target = target
-            }
-            button.isEnabled = enabled
             textButtonlabel.attributedStringValue = NSAttributedString(string: stringValue, attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle])
-            if toolTip != "" {
-                button.toolTip = toolTip
-            }
-            self.view.isHidden = isHidden
         } else if (buttonType == .Image) {
             if (state == .Norm) {
                 imageButtonBox.fillColor = background
@@ -277,37 +293,25 @@ class KMDesignButton: NSViewController {
                 imageButtonBox.borderColor = borderColor_disabled
                 imageButtonBox.cornerRadius = CGFloat(cornerRadius_disabled)
             }
-            button.action = action
-            button.target = target
-            button.isEnabled = enabled
-            if toolTip != "" {
-                button.toolTip = toolTip
-            }
-            self.view.isHidden = isHidden
         }  else if (buttonType == .TextImage) {
             let paragraphStyle = NSMutableParagraphStyle()
             if textImage_type == .Up {
                 textImageButtonBox.contentView = textImage_upView
                 textImage_upTextfield.isEditable = editable
-                textImage_upTextfield.attributedStringValue = NSAttributedString(string: stringValue, attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle])
                 textImage_upTextfield.font = font
             } else if textImage_type == .Left {
                 textImageButtonBox.contentView = textImage_leftView
                 textImage_leftTextfield.isEditable = editable
-                textImage_leftTextfield.attributedStringValue = NSAttributedString(string: stringValue, attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle])
                 textImage_leftTextfield.font = font
             } else if textImage_type == .Down {
                 textImageButtonBox.contentView = textImage_downView
                 textImage_downTextfield.isEditable = editable
-                textImage_downTextfield.attributedStringValue = NSAttributedString(string: stringValue, attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle])
                 textImage_downTextfield.font = font
             } else if textImage_type == .Right {
                 textImageButtonBox.contentView = textImage_rightView
                 textImage_rightTextfield.isEditable = editable
-                textImage_rightTextfield.attributedStringValue = NSAttributedString(string: stringValue, attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle])
                 textImage_rightTextfield.font = font
             }
-            button.isEnabled = enabled
             
             if textImage_state == .Norm {
                 textImageButtonBox.fillColor = background
@@ -386,13 +390,6 @@ class KMDesignButton: NSViewController {
                 textImageButtonBox.cornerRadius = CGFloat(cornerRadius_disabled)
                 paragraphStyle.lineSpacing = lineHeight_disabled
             }
-            button.target = target
-            button.action = action
-            button.isEnabled = enabled
-            if toolTip != "" {
-                button.toolTip = toolTip
-            }
-            self.view.isHidden = isHidden
             
             textImage_upImageHeight.constant = CGFloat(textImage_imageHeight)
             textImage_upImageWidth.constant = CGFloat(textImage_imageWidth)
@@ -404,15 +401,19 @@ class KMDesignButton: NSViewController {
             textImage_rightImageWidth.constant = CGFloat(textImage_imageWidth)
             
             if textImage_type == .Up {
+                textImage_upTextfield.attributedStringValue = NSAttributedString(string: stringValue, attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle])
                 textImage_upPadding_spacing.constant = CGFloat(textImage_paddingSpacing)
                 textImage_upItem_spacing.constant = CGFloat(textImage_itemSpacing)
             } else if textImage_type == .Left {
+                textImage_leftTextfield.attributedStringValue = NSAttributedString(string: stringValue, attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle])
                 textImage_leftPadding_spacing.constant = CGFloat(textImage_paddingSpacing)
                 textImage_leftItem_spacing.constant = CGFloat(textImage_itemSpacing)
             } else if textImage_type == .Down {
+                textImage_downTextfield.attributedStringValue = NSAttributedString(string: stringValue, attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle])
                 textImage_downPadding_spacing.constant = CGFloat(textImage_paddingSpacing)
                 textImage_downItem_spacing.constant = CGFloat(textImage_itemSpacing)
             } else if textImage_type == .Right {
+                textImage_rightTextfield.attributedStringValue = NSAttributedString(string: stringValue, attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle])
                 textImage_rightPadding_spacing.constant = CGFloat(textImage_paddingSpacing)
                 textImage_rightItem_spacing.constant = CGFloat(textImage_itemSpacing)
             }

+ 23 - 3
PDF Office/PDF Office/Class/Home/ViewController/customViewController/KMDesignPropertySelector.swift

@@ -138,6 +138,29 @@ class KMDesignPropertySelector: KMDesignBase {
         }
     }
 
+    var action: Selector {
+        get {
+            return _action!
+        }
+        set {
+            _action = newValue
+            if _action != nil {
+                button.action = _action
+            }
+        }
+    }
+    
+    var target: AnyObject {
+        get {
+            return _target!
+        }
+        set {
+            _target = newValue
+            if _target != nil {
+                button.target = _target
+            }
+        }
+    }
     
     // MARK: Private Methods
 
@@ -158,8 +181,5 @@ class KMDesignPropertySelector: KMDesignBase {
             self.mainBox.borderColor = self.borderColor_sel
             self.icon.image = self.image_sel
         }
-        
-        button.target = target
-        button.action = action
     }
 }

+ 1 - 0
PDF Office/PDF Office/Class/Home/ViewController/customViewController/KMDesignSelect.swift

@@ -288,6 +288,7 @@ class KMSelectCell: NSTextFieldCell {
             _indexOfSelectedItem = newValue
         }
     }
+    
     var numberOfItems: Int {
         get {
             return items.count

+ 7 - 0
PDF Office/PDF Office/Class/KMLightMember/Controller/AccountInfo/KMAccountInfoWindowController.swift

@@ -89,6 +89,13 @@ class KMAccountInfoWindowController: NSWindowController {
             if success {
                 self.accountInfoView.userInfo = data
                 KMLightMemberManager.manager.reloadUserInfo()
+            } else {
+                if error?.code == 304 {
+                    NSApp.mainWindow!.endSheet(self.window!)
+                    self.window?.close()
+                    KMLightMemberManager.manager.logOut()
+                    accountInfoController = nil
+                }
             }
         }
     }

+ 10 - 0
PDF Office/PDF Office/Class/KMLightMember/Controller/Login&Register/KMLoginWindowController.swift

@@ -44,6 +44,16 @@ class KMLoginWindowController: NSWindowController {
     
     //MARK: 打开文件
     static func show(window: NSWindow, _ type: DataNavigationViewButtonActionType = .Batch, _ logType: KMRegisterLogType = .login) -> KMLoginWindowController? {
+        
+        var logType = logType
+        var count = UserDefaults.standard.value(forKey: "kFirstOpenAppCount")
+        
+        if (count as? Int == 1) {
+            if logType == .login  {
+                logType = .register
+            }
+        }
+        
         let controller: KMLoginWindowController = KMLoginWindowController.init(windowNibName: "KMLoginWindowController")
         controller.inputType = type
         controller.logType = logType

+ 2 - 2
PDF Office/PDF Office/Class/KMLightMember/Controller/VerificationCode/View/KMLightMemberAlertView.swift

@@ -49,8 +49,8 @@ class KMLightMemberAlertView: KMBaseXibView {
         
         self.titleLabel.stringValue = NSLocalizedString(KMRequestServerErrorCodeType.typeOfMessage(type: KMRequestServerErrorCodeType(rawValue: result.code)), comment: "")
         
-        DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) { [unowned self] in
-            self.fadeOut()
+        DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) { [weak self] in
+            self?.fadeOut()
         }
     }
     

+ 1 - 1
PDF Office/PDF Office/Class/KMLightMember/Controller/VerificationCode/View/KMVerificationCodeView.swift

@@ -127,7 +127,7 @@ class KMVerificationCodeView: KMBaseXibView {
                 textField!.textField.alignment = .center
                 textField?.superview?.border(NSColor(hex: "#DFE1E5"), 1, 4)
                 textField?.textField.onFocus = {
-                    textField?.superview?.border(NSColor(hex: "#1770F4"), 1, 4)
+                textField?.superview?.border(NSColor(hex: "#1770F4"), 1, 4)
                 }
                 
                 textField?.textDidEndEditing = { [unowned self] string in

+ 4 - 4
PDF Office/PDF Office/Class/KMLightMember/KMRequestServer/KMRequestServer.swift

@@ -15,7 +15,7 @@ enum KMRequestServerMethodType: String, CaseIterable {
     case delete = "DELETE"
 }
 
-typealias KMHttpRequestServerComplete = (_ task: URLSessionDataTask?, _ responseObject: AnyObject?, _ error: Error?) -> Void
+typealias KMHttpRequestServerComplete = (_ task: URLSessionDataTask?, _ responseObject: AnyObject?, _ error: NSError?) -> Void
 class KMRequestServer {
     var sessionManager: AFHTTPSessionManager!
     static let requestServer = KMRequestServer()
@@ -79,7 +79,7 @@ class KMRequestServer {
                     }
                 } failure: { task, error in
                     if (completion != nil) {
-                        completion!(task,nil,error);
+                        completion!(task, nil, error as NSError);
                     }
                 }
             } else {
@@ -92,7 +92,7 @@ class KMRequestServer {
                     }
                 } failure: { task, error in
                     if (completion != nil) {
-                        completion!(task,nil,error);
+                        completion!(task, nil, error as NSError);
                     }
                 }
 
@@ -107,7 +107,7 @@ class KMRequestServer {
                 }
             } failure: { task, error in
                 if (completion != nil) {
-                    completion!(task,nil,error);
+                    completion!(task, nil, error as NSError);
                 }
             }
         }

+ 16 - 2
PDF Office/PDF Office/Class/KMLightMember/Manager/KMRequestServerManager.swift

@@ -357,7 +357,21 @@ class KMRequestServerManager: NSObject {
                     complete(true, data, nil)
                 }
             } else {
-                complete(false ,nil, Result(error: error as NSError?))
+                var info = responseObject
+                if (error != nil) {
+                    let data = error?.userInfo["com.alamofire.serialization.response.error.data"]
+                    
+                    if (data != nil) {
+                        info = try!JSONSerialization.jsonObject(with: data as? Data ?? Data(), options: JSONSerialization.ReadingOptions.mutableLeaves) as AnyObject
+                    }
+                    
+                    let result = self.dealData(responseObject: info as! NSDictionary)
+                    if result.code == 200 {
+                        complete(true, nil, result)
+                    } else {
+                        complete(false, nil, result)
+                    }
+                }
             }
         }
     }
@@ -425,7 +439,7 @@ class KMRequestServerManager: NSObject {
         
         let result: NSDictionary = dic["result"] as? NSDictionary ?? [:]
         let code: Int = dic["code"] as? Int ?? 0
-        let message: String = dic["msg"] as! String
+        let message: String = dic["msg"] as? String ?? "unknown error"
         let error = NSError(domain: message, code: code)
         
         print(dic)

+ 52 - 41
PDF Office/PDF Office/Class/PDFTools/Convert/Controller/KMConvertBaseWindowController.swift

@@ -138,19 +138,23 @@ class KMConvertBaseWindowController: NSWindowController {
     
     @IBOutlet weak var leftBox: NSBox!
     @IBOutlet weak var prePDFView: KMCustomPDFView!
-    @IBOutlet weak var backButton: NSButton!
     @IBOutlet weak var numberBox: NSView!
     @IBOutlet weak var numberTextField: NSTextField!
     @IBOutlet weak var perLabel: NSTextField!
     @IBOutlet weak var totalNumberLabel: NSTextField!
-    @IBOutlet weak var nextButton: NSButton!
+    @IBOutlet weak var backBox: NSBox!
+    @IBOutlet weak var nextBox: NSBox!
     
     @IBOutlet weak var rightScrollView: NSScrollView!
     
     @IBOutlet weak var batchButton: NSButton!
-    @IBOutlet weak var canelButton: NSButton!
-    @IBOutlet weak var convertButton: NSButton!
-    
+    @IBOutlet weak var canelBox: NSBox!
+    @IBOutlet weak var convertBox: NSBox!
+    var canelButtonVC: KMDesignButton!
+    var convertButtonVC: KMDesignButton!
+    var backButtonVC: KMDesignButton!
+    var nextButtonVC: KMDesignButton!
+
     var itemClick: KMConvertBaseWindowControllerItemClick!
     
     var documentModel: KMDocumentModel!
@@ -184,6 +188,11 @@ class KMConvertBaseWindowController: NSWindowController {
         super.windowDidLoad()
         self.window?.appearance = NSAppearance(named: .aqua)
         
+        canelButtonVC = KMDesignButton.init(withType: .Text)
+        convertButtonVC = KMDesignButton.init(withType: .Text)
+        backButtonVC = KMDesignButton.init(withType: .Image)
+        nextButtonVC = KMDesignButton.init(withType: .Image)
+        
         if documentModel != nil {
             self.prePDFView.document = CPDFDocument(url: documentModel.documentURL)
             if (documentModel.owerPassword.isEmpty == false) {
@@ -206,12 +215,15 @@ class KMConvertBaseWindowController: NSWindowController {
         self.prePDFView.autoScales = true
         self.prePDFView.delegate = self
         
-        self.backButton.image = NSImage(named: "KMImageNameLeftButtonImage")
-        backButton.wantsLayer = true
-        backButton.layer?.borderWidth = 1
-        backButton.layer?.cornerRadius = 4
-        backButton.target = self
-        backButton.action = #selector(backButtonAction)
+        backBox.fillColor = .clear
+        backBox.contentView = backButtonVC.view
+        backButtonVC.target = self
+        backButtonVC.action = #selector(backButtonAction)
+        backButtonVC.image = NSImage(named: "KMImageNameLeftButtonImage")!
+        backButtonVC.image_disabled = NSImage(named: "KMImageNameLeftButtonImageDis")!
+        backButtonVC.button(bg: "pagination.selector.bg.norm")
+        backButtonVC.button(bg: "pagination.selector.bg.hov", state: .Hov)
+        backButtonVC.button(bg: "pagination.selector.bg.dis", state: .Disabled)
         
         numberBox.wantsLayer = true
         self.numberBox.layer?.backgroundColor = NSColor.white.cgColor
@@ -221,13 +233,16 @@ class KMConvertBaseWindowController: NSWindowController {
         numberTextField.delegate = self
         self.numberTextField.isBordered = false
         
-        self.nextButton.image = NSImage(named: "KMImageNameRightButtonImage")
-        nextButton.wantsLayer = true
-        nextButton.layer?.borderWidth = 1
-        nextButton.layer?.cornerRadius = 4
-        nextButton.target = self
-        nextButton.action = #selector(nextButtonAction)
-        
+        nextBox.fillColor = .clear
+        nextBox.contentView = nextButtonVC.view
+        nextButtonVC.target = self
+        nextButtonVC.action = #selector(nextButtonAction)
+        nextButtonVC.image = NSImage(named: "KMImageNameRightButtonImage")!
+        nextButtonVC.image_disabled = NSImage(named: "KMImageNameRightButtonImageDis")!
+        nextButtonVC.button(bg: "pagination.selector.bg.norm")
+        nextButtonVC.button(bg: "pagination.selector.bg.hov", state: .Hov)
+        nextButtonVC.button(bg: "pagination.selector.bg.dis", state: .Disabled)
+
         batchButton.title = NSLocalizedString("Batch", comment: "")
         batchButton.isBordered = false
         batchButton.wantsLayer = true
@@ -237,20 +252,26 @@ class KMConvertBaseWindowController: NSWindowController {
         batchButton.action = #selector(batchButtonAction)
         batchButton.isHidden = true
         
-        canelButton.title = NSLocalizedString("Cancel", comment: "")
-        canelButton.isBordered = false
-        canelButton.wantsLayer = true
-        canelButton.layer?.borderWidth = 1
-        canelButton.layer?.cornerRadius = 4
-        canelButton.target = self
-        canelButton.action = #selector(cancelButtonAction)
+        canelBox.fillColor = .clear
+        canelBox.contentView = canelButtonVC.view
+        canelButtonVC.target = self
+        canelButtonVC.action = #selector(cancelButtonAction)
+        canelButtonVC.stringValue = NSLocalizedString("Cancel", comment: "")
+        canelButtonVC.button(bg: "btn.sec.m.bg.norm", text: "btn.sec.m.mac-text.def")
+        canelButtonVC.button(bg: "btn.sec.m.bg.hov", text: "btn.sec.m.mac-text.def", state: .Hov)
+        canelButtonVC.button(bg: "btn.sec.m.bg.act", text: "btn.sec.m.mac-text.def", state: .Act)
+        canelButtonVC.button(bg: "btn.sec.m.bg.dis", text: "btn.sec.m.mac-text.dis", state: .Disabled)
         
-        convertButton.title = NSLocalizedString("Convert", comment: "")
-        convertButton.isBordered = false
-        convertButton.wantsLayer = true
-        convertButton.layer?.cornerRadius = 4
-        convertButton.target = self
-        convertButton.action = #selector(convertButtonAction)
+        convertBox.fillColor = .clear
+        convertBox.contentView = convertButtonVC.view
+        convertButtonVC.target = self
+        convertButtonVC.action = #selector(convertButtonAction)
+        convertButtonVC.stringValue = NSLocalizedString("Convert", comment: "")
+        convertButtonVC.button(bg: "btn.cta.m.bg.norm", text: "btn.cta.m.mac-text.def")
+        convertButtonVC.button(bg: "btn.cta.m.bg.hov", text: "btn.cta.m.mac-text.def", state: .Hov)
+        convertButtonVC.button(bg: "btn.cta.m.bg.act", text: "btn.cta.m.mac-text.def", state: .Act)
+        convertButtonVC.button(bg: "btn.cta.m.bg.dis", text: "btn.cta.m.mac-text.dis", state: .Disabled)
+
         
         self.rightScrollView.hasVerticalScroller = false
         self.rightScrollView.hasHorizontalScroller = false
@@ -264,25 +285,15 @@ class KMConvertBaseWindowController: NSWindowController {
         
         self.leftBox.fillColor = NSColor(hex: "#F7F8FA")
         self.prePDFView.backgroundColor = NSColor(hex: "#E6E7EB")
-        self.backButton.layer?.backgroundColor = NSColor(hex: "#DFE1E5").cgColor
-        self.backButton.layer?.borderColor = NSColor.buttonBorderColor().cgColor
         self.numberBox.layer?.borderColor = NSColor(hex: "#DFE1E5").cgColor
         self.perLabel.textColor = NSColor.titleColor()
         self.perLabel.font = .SFProTextRegular(12)
         self.totalNumberLabel.textColor = NSColor.titleColor()
         self.totalNumberLabel.font = .SFProTextRegular(12)
-        self.nextButton.layer?.backgroundColor = NSColor(hex: "#DFE1E5").cgColor
-        self.nextButton.layer?.borderColor = NSColor.buttonBorderColor().cgColor
         
         self.batchButton.setTitleColor(NSColor.buttonTitleColor())
         self.batchButton.layer?.borderColor = NSColor.buttonBorderColor().cgColor
         self.batchButton.font = .SFProTextRegular(14)
-        self.canelButton.setTitleColor(NSColor.buttonTitleColor())
-        self.canelButton.layer?.borderColor = NSColor.buttonBorderColor().cgColor
-        self.canelButton.font = .SFProTextRegular(14)
-        self.convertButton.setTitleColor(NSColor.white)
-        self.convertButton.font = .SFProTextRegular(14)
-        self.convertButton.layer?.backgroundColor = NSColor.buttonFunctionBackgroundColor().cgColor
     }
     
     @objc func backButtonAction() {

+ 65 - 63
PDF Office/PDF Office/Class/PDFTools/Convert/Controller/KMConvertBaseWindowController.xib

@@ -8,12 +8,12 @@
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="KMConvertBaseWindowController" customModule="PDF_Office" customModuleProvider="target">
             <connections>
-                <outlet property="backButton" destination="wfc-7P-VL5" id="zYP-No-aYH"/>
+                <outlet property="backBox" destination="gFg-Q7-54m" id="8ww-CO-9PP"/>
                 <outlet property="batchButton" destination="iFO-Ki-C0L" id="KTA-dQ-WkN"/>
-                <outlet property="canelButton" destination="fKN-oU-IA4" id="PL6-X6-opR"/>
-                <outlet property="convertButton" destination="8yP-tY-qS1" id="dks-Ke-UYx"/>
+                <outlet property="canelBox" destination="Xgn-Dg-lq9" id="GtX-Me-dDU"/>
+                <outlet property="convertBox" destination="VGF-cR-pdk" id="hgN-0M-UF8"/>
                 <outlet property="leftBox" destination="qfL-fo-qSf" id="JS9-Y0-9cC"/>
-                <outlet property="nextButton" destination="Ogb-fd-PNY" id="jYC-xI-iQa"/>
+                <outlet property="nextBox" destination="r7Q-sv-pGM" id="uSh-eZ-cCQ"/>
                 <outlet property="numberBox" destination="XyN-M5-Ckr" id="DNm-ND-XlE"/>
                 <outlet property="numberTextField" destination="0fT-PL-boX" id="hzh-TQ-lIK"/>
                 <outlet property="perLabel" destination="OjN-CY-T87" id="DJD-nk-fRU"/>
@@ -30,7 +30,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="586" height="483"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="3008" height="1667"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
             <value key="minSize" type="size" width="586" height="483"/>
             <value key="maxSize" type="size" width="586" height="483"/>
             <view key="contentView" id="se5-gp-TjO">
@@ -70,19 +70,8 @@
                                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="mvl-fd-L7y" customClass="KMCustomPDFView" customModule="PDF_Office" customModuleProvider="target">
                                     <rect key="frame" x="16" y="56" width="182" height="248"/>
                                 </customView>
-                                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="wfc-7P-VL5" userLabel="backButton">
-                                    <rect key="frame" x="28" y="16" width="24" height="24"/>
-                                    <constraints>
-                                        <constraint firstAttribute="height" constant="24" id="AvJ-se-vZp"/>
-                                        <constraint firstAttribute="width" constant="24" id="xMh-35-ACn"/>
-                                    </constraints>
-                                    <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" state="on" imageScaling="proportionallyDown" inset="2" id="aUt-xp-Hqb">
-                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                        <font key="font" metaFont="system"/>
-                                    </buttonCell>
-                                </button>
                                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="XyN-M5-Ckr">
-                                    <rect key="frame" x="60" y="16" width="56" height="24"/>
+                                    <rect key="frame" x="56" y="16" width="56" height="24"/>
                                     <subviews>
                                         <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0fT-PL-boX">
                                             <rect key="frame" x="8" y="2" width="40" height="21"/>
@@ -102,7 +91,7 @@
                                     </constraints>
                                 </customView>
                                 <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="OjN-CY-T87">
-                                    <rect key="frame" x="122" y="18" width="9" height="20"/>
+                                    <rect key="frame" x="118" y="18" width="9" height="20"/>
                                     <textFieldCell key="cell" lineBreakMode="clipping" title="/" id="B2h-9Y-2H7">
                                         <font key="font" metaFont="system" size="17"/>
                                         <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -110,7 +99,7 @@
                                     </textFieldCell>
                                 </textField>
                                 <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="b9V-3O-PC8">
-                                    <rect key="frame" x="135" y="20" width="37" height="16"/>
+                                    <rect key="frame" x="131" y="20" width="37" height="16"/>
                                     <constraints>
                                         <constraint firstAttribute="width" relation="lessThanOrEqual" constant="35" id="Iqf-l4-eTt"/>
                                     </constraints>
@@ -120,33 +109,47 @@
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                     </textFieldCell>
                                 </textField>
-                                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Ogb-fd-PNY">
-                                    <rect key="frame" x="178" y="16" width="24" height="24"/>
+                                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="gFg-Q7-54m">
+                                    <rect key="frame" x="24" y="16" width="24" height="24"/>
+                                    <view key="contentView" id="8kU-hZ-NuI">
+                                        <rect key="frame" x="0.0" y="0.0" width="24" height="24"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    </view>
                                     <constraints>
-                                        <constraint firstAttribute="height" constant="24" id="7oH-z4-RQu"/>
-                                        <constraint firstAttribute="width" constant="24" id="ji0-jk-Rfj"/>
+                                        <constraint firstAttribute="width" constant="24" id="Gty-UI-C80"/>
+                                        <constraint firstAttribute="height" constant="24" id="Q9R-8R-JZp"/>
                                     </constraints>
-                                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="eeh-r3-CmY">
-                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                        <font key="font" metaFont="system"/>
-                                    </buttonCell>
-                                </button>
+                                    <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </box>
+                                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="r7Q-sv-pGM">
+                                    <rect key="frame" x="174" y="16" width="24" height="24"/>
+                                    <view key="contentView" id="qED-hg-bEm">
+                                        <rect key="frame" x="0.0" y="0.0" width="24" height="24"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    </view>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="24" id="Sh5-Vx-PjC"/>
+                                        <constraint firstAttribute="width" constant="24" id="X1t-Gn-6HW"/>
+                                    </constraints>
+                                    <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </box>
                             </subviews>
                             <constraints>
+                                <constraint firstItem="gFg-Q7-54m" firstAttribute="leading" secondItem="R1n-pF-yf9" secondAttribute="leading" constant="24" id="06U-Ru-CEG"/>
                                 <constraint firstItem="b9V-3O-PC8" firstAttribute="leading" secondItem="OjN-CY-T87" secondAttribute="trailing" constant="8" id="1XP-qZ-ZKN"/>
-                                <constraint firstItem="wfc-7P-VL5" firstAttribute="top" secondItem="mvl-fd-L7y" secondAttribute="bottom" constant="16" id="9GJ-IP-RnQ"/>
                                 <constraint firstAttribute="trailing" secondItem="mvl-fd-L7y" secondAttribute="trailing" constant="14" id="FSN-k0-xVE"/>
+                                <constraint firstItem="r7Q-sv-pGM" firstAttribute="top" secondItem="mvl-fd-L7y" secondAttribute="bottom" constant="16" id="Fmm-CD-NNm"/>
                                 <constraint firstItem="mvl-fd-L7y" firstAttribute="top" secondItem="R1n-pF-yf9" secondAttribute="top" constant="16" id="Gsl-47-3aT"/>
                                 <constraint firstAttribute="bottom" secondItem="mvl-fd-L7y" secondAttribute="bottom" constant="56" id="Ptg-Ls-spM"/>
-                                <constraint firstItem="Ogb-fd-PNY" firstAttribute="leading" secondItem="b9V-3O-PC8" secondAttribute="trailing" constant="8" id="W1V-En-41F"/>
+                                <constraint firstItem="XyN-M5-Ckr" firstAttribute="leading" secondItem="gFg-Q7-54m" secondAttribute="trailing" constant="8" id="Tdz-Lo-h5u"/>
                                 <constraint firstItem="XyN-M5-Ckr" firstAttribute="top" secondItem="mvl-fd-L7y" secondAttribute="bottom" constant="16" id="a1a-cz-g8h"/>
                                 <constraint firstItem="OjN-CY-T87" firstAttribute="leading" secondItem="XyN-M5-Ckr" secondAttribute="trailing" constant="8" id="aHX-uj-6qj"/>
                                 <constraint firstItem="b9V-3O-PC8" firstAttribute="centerY" secondItem="XyN-M5-Ckr" secondAttribute="centerY" id="bdF-Gv-pwp"/>
-                                <constraint firstItem="XyN-M5-Ckr" firstAttribute="leading" secondItem="wfc-7P-VL5" secondAttribute="trailing" constant="8" id="gHy-gY-hic"/>
-                                <constraint firstItem="Ogb-fd-PNY" firstAttribute="centerY" secondItem="b9V-3O-PC8" secondAttribute="centerY" id="gLN-p5-ZPD"/>
+                                <constraint firstItem="r7Q-sv-pGM" firstAttribute="centerY" secondItem="b9V-3O-PC8" secondAttribute="centerY" id="hGa-er-pWV"/>
+                                <constraint firstItem="gFg-Q7-54m" firstAttribute="top" secondItem="mvl-fd-L7y" secondAttribute="bottom" constant="16" id="hZL-5n-axr"/>
                                 <constraint firstItem="mvl-fd-L7y" firstAttribute="leading" secondItem="R1n-pF-yf9" secondAttribute="leading" constant="16" id="iUD-ID-dhg"/>
+                                <constraint firstItem="r7Q-sv-pGM" firstAttribute="leading" secondItem="b9V-3O-PC8" secondAttribute="trailing" constant="8" id="j47-sy-TXq"/>
                                 <constraint firstItem="OjN-CY-T87" firstAttribute="centerY" secondItem="XyN-M5-Ckr" secondAttribute="centerY" id="uvo-7G-YIG"/>
-                                <constraint firstItem="wfc-7P-VL5" firstAttribute="leading" secondItem="R1n-pF-yf9" secondAttribute="leading" constant="28" id="y3V-Qk-Nfo"/>
                             </constraints>
                         </view>
                         <constraints>
@@ -210,42 +213,41 @@
                                         <font key="font" metaFont="system"/>
                                     </buttonCell>
                                 </button>
-                                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="fKN-oU-IA4">
-                                    <rect key="frame" x="395" y="16" width="80" height="32"/>
+                                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Xgn-Dg-lq9">
+                                    <rect key="frame" x="394" y="16" width="80" height="32"/>
+                                    <view key="contentView" id="RWN-Pg-Jmx">
+                                        <rect key="frame" x="0.0" y="0.0" width="80" height="32"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    </view>
                                     <constraints>
-                                        <constraint firstAttribute="height" constant="32" id="Prv-Rf-K0I"/>
-                                        <constraint firstAttribute="width" constant="80" id="vsU-Rm-nB3"/>
+                                        <constraint firstAttribute="height" constant="32" id="Uzh-LG-qSz"/>
+                                        <constraint firstAttribute="width" constant="80" id="mOr-gZ-0ME"/>
                                     </constraints>
-                                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="YE4-KT-vVV">
-                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                        <font key="font" metaFont="system"/>
-                                        <string key="keyEquivalent" base64-UTF8="YES">
-Gw
-</string>
-                                    </buttonCell>
-                                </button>
-                                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8yP-tY-qS1">
-                                    <rect key="frame" x="491" y="16" width="80" height="32"/>
+                                    <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </box>
+                                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="VGF-cR-pdk">
+                                    <rect key="frame" x="490" y="16" width="80" height="32"/>
+                                    <view key="contentView" id="FtW-J0-ZXh">
+                                        <rect key="frame" x="0.0" y="0.0" width="80" height="32"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    </view>
                                     <constraints>
-                                        <constraint firstAttribute="height" constant="32" id="Et7-Ji-cad"/>
-                                        <constraint firstAttribute="width" constant="80" id="mKg-4c-4hq"/>
+                                        <constraint firstAttribute="height" constant="32" id="4cH-RP-idM"/>
+                                        <constraint firstAttribute="width" constant="80" id="vE5-JR-3tQ"/>
                                     </constraints>
-                                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="CRK-Jz-kwE">
-                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                        <font key="font" metaFont="system"/>
-                                    </buttonCell>
-                                </button>
+                                    <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </box>
                             </subviews>
                             <constraints>
+                                <constraint firstAttribute="bottom" secondItem="VGF-cR-pdk" secondAttribute="bottom" constant="16" id="5qw-4R-evS"/>
+                                <constraint firstAttribute="trailing" secondItem="VGF-cR-pdk" secondAttribute="trailing" constant="16" id="8zP-Ui-09y"/>
                                 <constraint firstItem="iFO-Ki-C0L" firstAttribute="leading" secondItem="5Iw-u0-5Gt" secondAttribute="leading" constant="16" id="BCf-YA-LeB"/>
                                 <constraint firstItem="lF5-Ex-sTg" firstAttribute="leading" secondItem="5Iw-u0-5Gt" secondAttribute="leading" id="BUF-0L-5Md"/>
                                 <constraint firstAttribute="trailing" secondItem="lF5-Ex-sTg" secondAttribute="trailing" id="EMG-1f-iRc"/>
-                                <constraint firstAttribute="bottom" secondItem="8yP-tY-qS1" secondAttribute="bottom" constant="16" id="QH6-T1-jmX"/>
+                                <constraint firstItem="VGF-cR-pdk" firstAttribute="leading" secondItem="Xgn-Dg-lq9" secondAttribute="trailing" constant="16" id="Hy6-cd-dD1"/>
                                 <constraint firstItem="lF5-Ex-sTg" firstAttribute="top" secondItem="5Iw-u0-5Gt" secondAttribute="top" id="YDe-a0-Xtc"/>
                                 <constraint firstAttribute="bottom" secondItem="iFO-Ki-C0L" secondAttribute="bottom" constant="16" id="cnC-Ei-DUg"/>
-                                <constraint firstAttribute="bottom" secondItem="fKN-oU-IA4" secondAttribute="bottom" constant="16" id="ibp-oq-K1P"/>
-                                <constraint firstItem="8yP-tY-qS1" firstAttribute="leading" secondItem="fKN-oU-IA4" secondAttribute="trailing" constant="16" id="paj-Yp-N0k"/>
-                                <constraint firstAttribute="trailing" secondItem="8yP-tY-qS1" secondAttribute="trailing" constant="15" id="ujw-8W-ixI"/>
+                                <constraint firstAttribute="bottom" secondItem="Xgn-Dg-lq9" secondAttribute="bottom" constant="16" id="r1d-jT-Xij"/>
                             </constraints>
                         </view>
                         <constraints>
@@ -271,7 +273,7 @@ Gw
             <connections>
                 <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
             </connections>
-            <point key="canvasLocation" x="13" y="101"/>
+            <point key="canvasLocation" x="13" y="100.5"/>
         </window>
         <customView id="LzC-nd-jo2" customClass="KMConvertWordSettingView" customModule="PDF_Office" customModuleProvider="target">
             <rect key="frame" x="0.0" y="0.0" width="276" height="250"/>
@@ -380,7 +382,7 @@ Gw
                     </buttonCell>
                 </button>
                 <comboBox verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="yE5-BA-JsU">
-                    <rect key="frame" x="24" y="14" width="233" height="25"/>
+                    <rect key="frame" x="23" y="15" width="234" height="23"/>
                     <comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" numberOfVisibleItems="5" id="X84-Gf-tPc">
                         <font key="font" metaFont="system"/>
                         <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -466,7 +468,7 @@ Gw
                                 </textFieldCell>
                             </textField>
                             <comboBox hidden="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="A3v-M6-Ruh">
-                                <rect key="frame" x="24" y="50" width="215" height="25"/>
+                                <rect key="frame" x="23" y="51" width="216" height="23"/>
                                 <comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" numberOfVisibleItems="5" id="KT9-cv-uGO">
                                     <font key="font" metaFont="system"/>
                                     <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -479,7 +481,7 @@ Gw
                                 </comboBoxCell>
                             </comboBox>
                             <comboBox verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="yhD-91-oLg">
-                                <rect key="frame" x="24" y="13" width="215" height="25"/>
+                                <rect key="frame" x="23" y="13" width="216" height="23"/>
                                 <comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" numberOfVisibleItems="5" id="TKk-wg-Ocx">
                                     <font key="font" metaFont="system"/>
                                     <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -574,7 +576,7 @@ Gw
                                 </buttonCell>
                             </button>
                             <comboBox verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="uah-L1-IyT">
-                                <rect key="frame" x="32" y="-14" width="214" height="25"/>
+                                <rect key="frame" x="31" y="-13" width="215" height="23"/>
                                 <comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" numberOfVisibleItems="5" id="X1R-ss-GZO">
                                     <font key="font" metaFont="system"/>
                                     <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>

+ 9 - 0
PDF Office/PDF Office/Class/PDFTools/Tools/KMBaseXibView/KMBaseXibView.swift

@@ -28,6 +28,7 @@ class KMBaseXibView: NSView {
         self.updateUI()
         self.updateLanguage()
         self.reloadData()
+        self.addNotification()
     }
     
     private func initContentView() {
@@ -82,4 +83,12 @@ class KMBaseXibView: NSView {
     func resetData() {
         
     }
+    
+    func addNotification() {
+        
+    }
+    
+    func removeNotification() {
+        
+    }
 }

+ 10 - 3
PDF Office/PDF Office/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m

@@ -719,7 +719,9 @@
 //边框颜色
 - (void)updateBorderOpacityView {
     CGFloat opacity = self.annotationModel.opacity;
-
+    if(self.annotationModel.annotations.count > 1) {
+        opacity = self.annotationModel.annotation.opacity;
+    }
     self.borderOpacitySlider.floatValue = opacity;
     self.borderOpacitySlider.toolTip = [NSString stringWithFormat:@"%@%%",@((int)(opacity*100))];
     self.borderOpacityComboBox.stringValue = [NSString stringWithFormat:@"%@%%",@((int)(opacity*100))];
@@ -730,6 +732,11 @@
 - (void)updateBorderWidthView
 {
     CGFloat lineWidth = self.annotationModel.lineWidth;
+    CPDFBorderStyle stype = self.annotationModel.style;
+    if(self.annotationModel.annotations.count > 1) {
+        lineWidth = self.annotationModel.annotation.borderWidth;
+        stype = self.annotationModel.annotation.border.style;
+    }
     self.borderWidthSlider.floatValue = lineWidth;
     self.borderWidthSlider.toolTip = [NSString stringWithFormat:@"%0.1f pt",lineWidth];
     self.borderWidthComboBox.stringValue = [NSString stringWithFormat:@"%0.1f pt",lineWidth];
@@ -737,7 +744,7 @@
     self.generalImageView.image = [self.annotationModel annotationImage];
     
     if (self.annotationModel.annotationType == CAnnotationTypeEraser)  return;
-    if (self.annotationModel.style == CPDFBorderStyleDashed) {
+    if (stype == CPDFBorderStyleDashed) {
         self.borderWidthStyleDotted.wantsLayer = YES;
         self.borderWidthStyleDotted.layer.backgroundColor = [NSColor colorWithRed:206.0/255.0 green:208.0/255.0 blue:212.0/255.0 alpha:0.6].CGColor;
         self.borderWidthStyleDotted.layer.borderWidth = 1.0;
@@ -748,7 +755,7 @@
         self.borderWidthStyleReal.layer.borderWidth = 0;
         self.borderWidthStyleReal.layer.cornerRadius = 0;
         self.borderWidthStyleReal.layer.borderColor = [NSColor clearColor].CGColor;
-    } else if (self.annotationModel.style == CPDFBorderStyleSolid) {
+    } else if (stype == CPDFBorderStyleSolid) {
         self.borderWidthStyleReal.wantsLayer = YES;
         self.borderWidthStyleReal.layer.backgroundColor = [NSColor colorWithRed:206.0/255.0 green:208.0/255.0 blue:212.0/255.0 alpha:0.6].CGColor;
         self.borderWidthStyleReal.layer.borderWidth = 1.0;

+ 5 - 0
PDF Office/PDF Office/Class/PDFWindowController/Toolbar/KMToolbarController.swift

@@ -19,6 +19,7 @@ import Cocoa
     @objc optional func changePDFViewGoToPreviousPageAction()
     @objc optional func showPDFViewPrintViewController()
     @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, zoomModel selectedTag:Int)
+    @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, zoomSting : String)
     @objc optional func mainToolDidClicked(_ toolController: KMToolbarController, _ type: KMToolbarViewType, _ item: KMToolBoxItem)
     @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, shareDocument item:NSMenuItem)
     @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, shareFlatten item:NSMenuItem)
@@ -392,6 +393,10 @@ extension KMToolbarController: KMToolbarViewControllerDelegate {
     func toolbarViewController(_ viewController: KMToolbarViewController, zoomModel selectedTag: Int) {
         self.delegate?.toolbarViewController?(viewController, zoomModel: selectedTag)
     }
+
+    func toolbarViewController(_ viewController:KMToolbarViewController, zoomSting : String) {
+        self.delegate?.toolbarViewController?(viewController, zoomSting: zoomSting)
+    }
     
     func changePDFViewZoomInAction() {
         self.delegate?.changePDFViewZoomInAction?()

+ 10 - 1
PDF Office/PDF Office/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift

@@ -58,6 +58,7 @@ import Cocoa
     @objc optional func changePDFViewGotoNextPageAction()
     @objc optional func changePDFViewGoToPreviousPageAction()
     @objc optional func showPDFViewPrintViewController()
+    @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, zoomSting : String)
     @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, zoomModel selectedTag:Int)
     @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, shareDocument item:NSMenuItem)
     @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, shareFlatten item:NSMenuItem)
@@ -68,7 +69,7 @@ import Cocoa
     @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, rightPanel toolbarItem: KMToolBoxItem)
 }
 
-class KMToolbarViewController: NSViewController {
+class KMToolbarViewController: NSViewController, NSTextFieldDelegate {
 
     var toolbar : KMToolbar!
     var toolbarType : KMToolbarViewType = KMToolbarViewType.None
@@ -83,6 +84,7 @@ class KMToolbarViewController: NSViewController {
     var shareButton = KMToolbarClickButton()
     override func viewDidLoad() {
         super.viewDidLoad()
+        self.zoomTextField.delegate = self
         NotificationCenter.default.addObserver(self, selector: #selector(listViewAnnotationTypeChangeNotification), name: Notification.Name("CPDFListViewAnnotationTypeChangeNotification"), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(listViewAnnotationTypeChangeNotification), name: Notification.Name("CPDFListViewToolModeChangeNotification"), object: nil)
     }
@@ -267,6 +269,13 @@ class KMToolbarViewController: NSViewController {
         }
         return KMToolBoxItem()
     }
+    
+    func controlTextDidEndEditing(_ obj: Notification) {
+        let textField = obj.object as? NSTextField
+        if textField == self.zoomTextField {
+            self.delegate?.toolbarViewController?(self, zoomSting: self.zoomTextField.stringValue)
+        }
+    }
 }
 
 extension KMToolbarViewController : KMNewToolbarDelegate,NSToolbarItemValidation {

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

@@ -1157,7 +1157,7 @@ extension KMMainViewController {
     
     // 开启/关闭右边栏
     @objc func toggleRightPane() -> Void {
-        if lastRightPanWidth > 1 {
+        if lastRightPanWidth > 5 {
             applyLeftSideWidth(lastLeftPanWidth, rightSideWidth: 0)
         } else {
             applyLeftSideWidth(lastLeftPanWidth, rightSideWidth: defaultRightWidth)
@@ -1362,6 +1362,11 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
        viewController.zoomTextField.stringValue =  "\(Int(self.listView.scaleFactor*100))%"
     }
     
+    func toolbarViewController(_ viewController: KMToolbarViewController, zoomSting: String) {
+        self.listView.scaleFactor = CGFloat((NSString(string: zoomSting)).floatValue / 100.0)
+        viewController.zoomTextField.stringValue =  "\(Int(self.listView.scaleFactor*100))%"
+    }
+    
     func changePDFViewZoomInAction() {
         self.listView.zoomIn(nil)
         self.updateZoomInOutButtonState()

+ 8 - 3
PDF Office/PDF Office/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -736,9 +736,14 @@ import Cocoa
                 self.rightSideViewController?.reloadDataWithPDFView(pdfView: pdfListView, isShow: true)
                 self.openRightPane()
             }
-        } else if (annotations.count == 0 && pdfListView.annotationType == .unkown){
-            self.rightSideViewController?.reloadDataWithPDFView(pdfView: pdfListView, isShow: false)
-            self.closeRightPane()
+        } else if (annotations.count == 0){
+            if  pdfListView.annotationType == .unkown {
+                self.rightSideViewController?.reloadDataWithPDFView(pdfView: pdfListView, isShow: false)
+                self.closeRightPane()
+            } else {
+                self.rightSideViewController?.reloadDataWithPDFView(pdfView: pdfListView, isShow: true)
+                self.openRightPane()
+            }
         }
     }