Browse Source

【2025】【Layout-Toolbar】Toolbar搭建

niehaoyu 4 months ago
parent
commit
f8848c6977
28 changed files with 1086 additions and 157 deletions
  1. 1 1
      PDF Office/KMComponentLibrary/KMComponentLibrary.xcodeproj/project.pbxproj
  2. 68 71
      PDF Office/KMComponentLibrary/KMComponentLibrary/View/Select/SelectZoom/ComponentSelectZoom.swift
  3. 21 3
      PDF Office/KMComponentLibrary/KMComponentLibrary/View/Select/SelectZoom/ComponentSelectZoomProperty.swift
  4. 68 65
      PDF Office/KMComponentLibrary/KMComponentLibrary/View/Tabs/ComponentTabsItem.swift
  5. 2 2
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift
  6. 12 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_minus.imageset/Contents.json
  7. 71 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_minus.imageset/toolbar_minus.pdf
  8. 12 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_minus_dis.imageset/Contents.json
  9. 71 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_minus_dis.imageset/toolbar_minus_dis.pdf
  10. 12 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_plus.imageset/Contents.json
  11. 79 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_plus.imageset/toolbar_plus.pdf
  12. 12 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_plus_dis.imageset/Contents.json
  13. 79 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_plus_dis.imageset/toolbar_plus_dis.pdf
  14. 12 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_print.imageset/Contents.json
  15. BIN
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_print.imageset/toolbar_print.pdf
  16. 12 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_redo.imageset/Contents.json
  17. 83 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_redo.imageset/toolbar_redo.pdf
  18. 12 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_rightView.imageset/Contents.json
  19. 93 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_rightView.imageset/toolbar_rightView.pdf
  20. 12 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_share.imageset/Contents.json
  21. 95 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_share.imageset/toolbar_share.pdf
  22. 12 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_undo.imageset/Contents.json
  23. 83 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_undo.imageset/toolbar_undo.pdf
  24. 12 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_zoom_dropdown.imageset/Contents.json
  25. 76 0
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_zoom_dropdown.imageset/toolbar_zoom_dropdown.pdf
  26. 33 2
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFView/Toolbar/KMPDFToolbarController.swift
  27. 42 1
      PDF Office/PDF Master/KMClass/KMPDFViewController/PDFView/Toolbar/KMPDFToolbarManager.swift
  28. 1 12
      PDF Office/PDF Master/KMClass/Settings/SettingsDisplayView.swift

+ 1 - 1
PDF Office/KMComponentLibrary/KMComponentLibrary.xcodeproj/project.pbxproj

@@ -908,8 +908,8 @@
 		BB5A9C512CB64D4800F64C1F /* SelectZoom */ = {
 			isa = PBXGroup;
 			children = (
-				BB5A9C522CB64D4800F64C1F /* ComponentSelectZoom.swift */,
 				BB5A9C532CB64D4800F64C1F /* ComponentSelectZoomProperty.swift */,
+				BB5A9C522CB64D4800F64C1F /* ComponentSelectZoom.swift */,
 				BB5A9C542CB64D4800F64C1F /* ComponentSelectZoom.xib */,
 			);
 			path = SelectZoom;

+ 68 - 71
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Select/SelectZoom/ComponentSelectZoom.swift

@@ -15,11 +15,11 @@ import AppKit
     @objc optional func componentSelectZoomDidReduce(view: ComponentSelectZoom)
     
     @objc optional func componentSelectZoomDidAdd(view: ComponentSelectZoom)
-
+    
 }
 
 public class ComponentSelectZoom: ComponentBaseXibView {
-
+    
     @IBOutlet var contendBox: NSBox!
     @IBOutlet var reduceButton: ComponentButton!
     @IBOutlet var addButton: ComponentButton!
@@ -29,11 +29,9 @@ public class ComponentSelectZoom: ComponentBaseXibView {
     
     // MARK: Private Property
     private var _properties : ComponentSelectZoomProperty = ComponentSelectZoomProperty()
-
-    private var menuitemPropertys: [ComponentMenuitemProperty] = []
-    
+        
     private var selItemProperty: ComponentMenuitemProperty? = ComponentMenuitemProperty()
-     
+    
     private var isGroupViewShow: Bool = false
     
     private var groupView: ComponentGroup!
@@ -66,31 +64,14 @@ public class ComponentSelectZoom: ComponentBaseXibView {
         contendBox.fillColor = NSColor.clear
         
         reduceButton.properties = ComponentButtonProperty(type: .text_gray_opacity, size: .xs, state: .normal, onlyIcon: true)
-        reduceButton.properties.propertyInfo.leftIcon_nor = ComponentLibrary.shared.image(forResource: "reduce")
-        reduceButton.properties.propertyInfo.leftIcon_dis = ComponentLibrary.shared.image(forResource: "reduce_dis")
-        reduceButton.reloadData()
         reduceButton.setTarget(self, action: #selector(reductButtonClick(_ :)))
         
         addButton.properties = ComponentButtonProperty(type: .text_gray_opacity, size: .xs, state: .normal, onlyIcon: true)
-        addButton.properties.propertyInfo.leftIcon_nor = ComponentLibrary.shared.image(forResource: "add")
-        addButton.properties.propertyInfo.leftIcon_dis = ComponentLibrary.shared.image(forResource: "add_dis")
-        addButton.reloadData()
         addButton.setTarget(self, action: #selector(addButtonClick(_ :)))
         
         infoBox.borderWidth = 0
         infoBox.borderColor = NSColor.clear
         
-        var menuItemArr: [ComponentMenuitemProperty] = []
-        for i in 0...5 {
-            let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, 
-                                                                                           itemSelected: false,
-                                                                                           isDisabled: false,
-                                                                                           keyEquivalent: nil,
-                                                                                           text: "menu item - " + String(i))
-            menuItemArr.append(properties_Menuitem)
-        }
-        self.updateMenuItemsArr(menuItemArr)
-        
     }
     
     //Setter
@@ -103,34 +84,48 @@ public class ComponentSelectZoom: ComponentBaseXibView {
             
             ComponentLibrary.shared.configSelectZoomComponent(properties: _properties)
             
-            self.reloadData()
-           
+            reloadData()
+            
         }
     }
     
     //MARK: - Public
     public func reloadData() {
+        setupUI()
         
-        self.setupUI()
-        
-        self.refreshUI()
-    }
-    
-    public func updateMenuItemsArr(_ propertys: [ComponentMenuitemProperty]) {
-        self.menuitemPropertys = propertys
-        
+        refreshUI()
     }
+     
     
     public func updatePropertyText(_ text: String) {
         properties.text = text
         
-        self.refreshUI()
+        refreshUI()
         
     }
     
     //MARK: - SetupUI
     func setupUI() {
         
+        if let image = properties.leftIcon_nor {
+            reduceButton.properties.propertyInfo.leftIcon_nor = image
+        }
+        if let image = properties.leftIcon_dis {
+            reduceButton.properties.propertyInfo.leftIcon_dis = image
+        }
+        if let image = properties.dropdownIcon {
+            dropdownImage.image = image
+        }
+        if let image = properties.rightIcon_nor {
+            addButton.properties.propertyInfo.leftIcon_nor = image
+        }
+        if let image = properties.rightIcon_dis {
+            addButton.properties.propertyInfo.leftIcon_dis = image
+        }
+        
+        reduceButton.reloadData()
+        
+        addButton.reloadData()
     }
     
     func refreshUI() {
@@ -152,10 +147,11 @@ public class ComponentSelectZoom: ComponentBaseXibView {
             infoColor = properties.propertyInfo.color_dis
             infoLabel.textColor = properties.propertyInfo.textColor_dis
         }
+        infoLabel.stringValue = properties.text
         
         infoBox.fillColor = infoColor
         infoBox.cornerRadius = properties.propertyInfo.cornerRadius
-          
+        
     }
     
     func showGroupView() {
@@ -164,7 +160,7 @@ public class ComponentSelectZoom: ComponentBaseXibView {
         }
         
         var viewHeight: CGFloat = 8.0
-        for item in self.menuitemPropertys {
+        for item in properties.menuItemArr {
             item.state = .normal
             item.itemSelected = false
             if item == selItemProperty {
@@ -184,77 +180,78 @@ public class ComponentSelectZoom: ComponentBaseXibView {
         groupView?.reloadData()
         groupView.groupDelegate = self
         groupView?.show(relativeTo: self)
-        groupView?.updateGroupInfo(menuitemPropertys)
-        self.isGroupViewShow = true
+        groupView?.updateGroupInfo(properties.menuItemArr)
+        
+        isGroupViewShow = true
     }
     
     func hideGroupView() {
-        self.groupView?.removeGroupView()
+        groupView?.removeGroupView()
         
-        self.isGroupViewShow = false
+        isGroupViewShow = false
     }
-     
+    
     @objc func reductButtonClick(_ sender: ComponentButton) {
-        self.delegate?.componentSelectZoomDidReduce?(view: self)
+        delegate?.componentSelectZoomDidReduce?(view: self)
     }
     
     @objc func addButtonClick(_ sender: ComponentButton) {
-        self.delegate?.componentSelectZoomDidAdd?(view: self)
+        delegate?.componentSelectZoomDidAdd?(view: self)
     }
     
     //MARK: - MouseEvent
     public override func mouseEntered(with event: NSEvent) {
         super.mouseEntered(with: event)
         
-        self.refreshUI()
+        refreshUI()
     }
     
     public override func mouseMoved(with event: NSEvent) {
         super.mouseMoved(with: event)
         
-        if self.properties.isDisabled == false &&
+        if properties.isDisabled == false &&
             properties.state != .pressed {
-            let point = self.convert(event.locationInWindow, from: nil)
-            if CGRectContainsPoint(self.infoBox.frame, point) {
-                self.properties.state = .hover
+            let point = convert(event.locationInWindow, from: nil)
+            if CGRectContainsPoint(infoBox.frame, point) {
+                properties.state = .hover
             } else {
                 properties.state = .normal
             }
-            self.refreshUI()
+            refreshUI()
         }
     }
-     
+    
     public override func mouseExited(with event: NSEvent) {
         super.mouseExited(with: event)
         
-        if self.properties.isDisabled == false &&
+        if properties.isDisabled == false &&
             properties.state != .pressed {
-            self.properties.state = .normal
+            properties.state = .normal
         }
         
-        self.refreshUI()
+        refreshUI()
     }
     
     public override func mouseDown(with event: NSEvent) {
         super.mouseDown(with: event)
         
-        if self.properties.isDisabled == false {
-            let point = self.convert(event.locationInWindow, from: nil)
-            if CGRectContainsPoint(self.infoBox.frame, point) {
-                self.properties.state = .pressed
+        if properties.isDisabled == false {
+            let point = convert(event.locationInWindow, from: nil)
+            if CGRectContainsPoint(infoBox.frame, point) {
+                properties.state = .pressed
                 
-                self.showGroupView()
+                showGroupView()
             }
         }
         
-        self.refreshUI()
+        refreshUI()
         
     }
     
     public override func mouseUp(with event: NSEvent) {
         super.mouseUp(with: event)
         
-         
+        
     }
     
 }
@@ -262,24 +259,24 @@ public class ComponentSelectZoom: ComponentBaseXibView {
 
 extension ComponentSelectZoom: ComponentGroupDelegate {
     public func componentGroupDidDismiss(group: ComponentGroup?) {
-        self.properties.state = .normal
+        properties.state = .normal
         
-        self.isGroupViewShow = false
+        isGroupViewShow = false
         
-        self.hideGroupView()
-         
-        self.refreshUI()
+        hideGroupView()
+        
+        refreshUI()
     }
     
     public func componentGroupDidSelect(group: ComponentGroup?, menuItemProperty: ComponentMenuitemProperty?) {
-        self.infoLabel.stringValue = menuItemProperty?.text ?? ""
+        properties.text = menuItemProperty?.text ?? ""
+        
+        properties.state = .normal
         
-        self.properties.state = .normal
+        refreshUI()
         
-        self.refreshUI()
+        selItemProperty = menuItemProperty
         
-        self.selItemProperty = menuItemProperty
-         
-        self.delegate?.componentSelectZoomDidSelect?(view: self, menuItemProperty: selItemProperty)
+        delegate?.componentSelectZoomDidSelect?(view: self, menuItemProperty: selItemProperty)
     }
 }

+ 21 - 3
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Select/SelectZoom/ComponentSelectZoomProperty.swift

@@ -13,18 +13,36 @@ import Cocoa
 public class ComponentSelectZoomProperty: NSObject {
     public var state: ComponentState = .normal    //状态
     public var isDisabled: Bool = false           //禁用状态
-    public var text: String?                      //文字信息
+    public var text: String = ""                     //文字信息
+    public var leftIcon_nor: NSImage? = nil
+    public var leftIcon_dis: NSImage? = nil
+    public var dropdownIcon: NSImage? = nil
+    public var rightIcon_nor: NSImage? = nil
+    public var rightIcon_dis: NSImage? = nil
     
     public var propertyInfo = SelectZoomPropertyInfo()
-    
+
+    public var menuItemArr: [ComponentMenuitemProperty] = []
+
     public init(state: ComponentState = .normal,
                 isDisabled: Bool = false,
-                text: String? = nil) {
+                text: String = "",
+                leftIcon_nor: NSImage? = nil,
+                leftIcon_dis: NSImage? = nil,
+                dropdownIcon: NSImage? = nil,
+                rightIcon_nor: NSImage? = nil,
+                rightIcon_dis: NSImage? = nil) {
         
         self.state = state
         self.isDisabled = isDisabled
         self.text = text
         
+        self.leftIcon_nor = leftIcon_nor
+        self.leftIcon_dis = leftIcon_dis
+        self.dropdownIcon = dropdownIcon
+        self.rightIcon_nor = rightIcon_nor
+        self.rightIcon_dis = rightIcon_dis
+        
     }
 }
 

+ 68 - 65
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Tabs/ComponentTabsItem.swift

@@ -51,8 +51,8 @@ public class ComponentTabsItem: ComponentBaseXibView {
     public override func awakeFromNib() {
         super.awakeFromNib()
         
-        self.iconImage.autoresizingMask = [.maxXMargin, .minYMargin, .maxYMargin]
-        self.titleLabel.autoresizingMask = [.minXMargin, .maxXMargin, .minYMargin, .maxYMargin]
+        iconImage.autoresizingMask = [.maxXMargin, .minYMargin, .maxYMargin]
+        titleLabel.autoresizingMask = [.minXMargin, .maxXMargin, .minYMargin, .maxYMargin]
         
     }
     
@@ -65,9 +65,9 @@ public class ComponentTabsItem: ComponentBaseXibView {
             
             ComponentLibrary.shared.configTabsComponent(properties: _properties)
             
-            self.setupUI()
+            setupUI()
             
-            self.refreshUI()
+            refreshUI()
         }
     }
     
@@ -83,55 +83,40 @@ public class ComponentTabsItem: ComponentBaseXibView {
     //MARK: - SetupUI
     func setupUI() {
         
-        self.contendBox.borderWidth = self.properties.propertyInfo.borderWidth
-        self.contendBox.cornerRadius = self.properties.propertyInfo.cornerRadius
+        contendBox.borderWidth = properties.propertyInfo.borderWidth
+        contendBox.cornerRadius = properties.propertyInfo.cornerRadius
         
-        self.lineBox.isHidden = true
-        self.lineBox.borderWidth = 0
-        if let color = self.properties.propertyInfo.lineColor {
-            self.lineBox.fillColor = color
+        lineBox.isHidden = true
+        lineBox.borderWidth = 0
+        if let color = properties.propertyInfo.lineColor {
+            lineBox.fillColor = color
         }
         
-        if self.properties.tabsType == .fill {
-            
-        } else if self.properties.tabsType == .underline_Center {
-            self.lineBoxLeftConst.constant = 25
-            self.lineBoxRightConst.constant = 25
-            self.lineBoxHeightConst.constant = 3
-            self.lineBox.cornerRadius = 1.5
-            
-        } else if self.properties.tabsType == .underline_Fill {
-            self.lineBoxLeftConst.constant = 0
-            self.lineBoxRightConst.constant = 0
-            self.lineBoxHeightConst.constant = 2
-            
-        } else if self.properties.tabsType == .onlyText {
-            
-        }
+       
         
-        self.titleLabel.font = properties.propertyInfo.textFont
+        titleLabel.font = properties.propertyInfo.textFont
         
-        self.titleLabel.stringValue = self.properties.title ?? ""
-        self.titleLabel.sizeToFit()
+        titleLabel.stringValue = properties.title ?? ""
+        titleLabel.sizeToFit()
         
         var viewWidthValue: CGFloat = 0
-        viewWidthValue += self.titleLabel.frame.size.width
-        viewWidthValue += self.properties.propertyInfo.layout_paddingLeft
-        viewWidthValue += self.properties.propertyInfo.layout_paddingRight
+        viewWidthValue += titleLabel.frame.size.width
+        viewWidthValue += properties.propertyInfo.layout_paddingLeft
+        viewWidthValue += properties.propertyInfo.layout_paddingRight
         
-        self.iconImage.isHidden = true
-        if self.properties.showIcon == true {
-            self.iconImage.isHidden = false
+        iconImage.isHidden = true
+        if properties.showIcon == true {
+            iconImage.isHidden = false
             
             viewWidthValue += 16
-            viewWidthValue += self.properties.propertyInfo.layout_gap
+            viewWidthValue += properties.propertyInfo.layout_gap
             
         } else {
             
         }
         
-        self.properties.propertyInfo.viewWidth = viewWidthValue
-        self.properties.propertyInfo.viewHeight = 40
+        properties.propertyInfo.viewWidth = viewWidthValue
+        properties.propertyInfo.viewHeight = 40
         
         DispatchQueue.main.async {
             var labelRect = self.titleLabel.frame
@@ -145,45 +130,63 @@ public class ComponentTabsItem: ComponentBaseXibView {
             }
             labelRect.origin.y = CGRectGetHeight(self.frame)/2 - labelRect.size.height/2
             self.titleLabel.frame = labelRect
+            
+            if self.properties.tabsType == .fill {
+                
+            } else if self.properties.tabsType == .underline_Center {
+                
+                self.lineBoxLeftConst.constant = max((CGRectGetWidth(self.frame) - 32)/2, 0)
+                self.lineBoxRightConst.constant = max((CGRectGetWidth(self.frame) - 32)/2, 0)
+                self.lineBoxHeightConst.constant = 3
+                self.lineBox.cornerRadius = 1.5
+                
+            } else if self.properties.tabsType == .underline_Fill {
+                self.lineBoxLeftConst.constant = 0
+                self.lineBoxRightConst.constant = 0
+                self.lineBoxHeightConst.constant = 2
+                
+            } else if self.properties.tabsType == .onlyText {
+                
+            }
         }
         
     }
     
     func refreshUI() {
-        self.lineBox.isHidden = true
+        lineBox.isHidden = true
         
-        if let color = self.properties.propertyInfo.lineColor {
-            self.lineBox.fillColor = color
+        if let color = properties.propertyInfo.lineColor {
+            lineBox.fillColor = color
         }
         
-        if self.properties.tabsType == .fill {
+        if properties.tabsType == .fill {
             
-        } else if self.properties.tabsType == .underline_Center {
-            if self.properties.state == .pressed {
-                self.lineBox.isHidden = false
+        } else if properties.tabsType == .underline_Center {
+            if properties.state == .pressed {
+                lineBox.isHidden = false
             }
-        } else if self.properties.tabsType == .underline_Fill {
-            if self.properties.state == .pressed {
-                self.lineBox.isHidden = false
+        } else if properties.tabsType == .underline_Fill {
+            if properties.state == .pressed {
+                lineBox.isHidden = false
             }
-        } else if self.properties.tabsType == .onlyText {
+        } else if properties.tabsType == .onlyText {
             
         }
         
-        if self.properties.state == .normal {
-            self.titleLabel.textColor = properties.propertyInfo.textColor
+        if properties.state == .normal {
+            titleLabel.textColor = properties.propertyInfo.textColor
             
-        } else if self.properties.state == .hover {
-            self.titleLabel.textColor = properties.propertyInfo.textColor_hov
+        } else if properties.state == .hover {
+            titleLabel.textColor = properties.propertyInfo.textColor_hov
             
-        } else if self.properties.state == .pressed {
-            self.titleLabel.textColor = properties.propertyInfo.textColor_Active
+        } else if properties.state == .pressed {
+            titleLabel.textColor = properties.propertyInfo.textColor_Active
             
         }
     }
     
     public func reloadData() {
-        self.refreshUI()
+        refreshUI()
         
     }
     
@@ -196,11 +199,11 @@ public class ComponentTabsItem: ComponentBaseXibView {
     public override func mouseEntered(with event: NSEvent) {
         super.mouseEntered(with: event)
         
-        if self.properties.state != .pressed {
-            self.properties.state = .hover
+        if properties.state != .pressed {
+            properties.state = .hover
         }
         
-        self.refreshUI()
+        refreshUI()
     }
     
     public override func mouseMoved(with event: NSEvent) {
@@ -212,21 +215,21 @@ public class ComponentTabsItem: ComponentBaseXibView {
     public override func mouseExited(with event: NSEvent) {
         super.mouseExited(with: event)
         
-        if self.properties.state != .pressed {
-            self.properties.state = .normal
+        if properties.state != .pressed {
+            properties.state = .normal
         }
         
-        self.refreshUI()
+        refreshUI()
     }
     
     public override func mouseDown(with event: NSEvent) {
         super.mouseDown(with: event)
         
-        if self.properties.state != .pressed {
-            self.properties.state = .pressed
+        if properties.state != .pressed {
+            properties.state = .pressed
         }
         
-        self.refreshUI()
+        refreshUI()
         
     }
     

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

@@ -377,9 +377,9 @@ import Cocoa
         self.srHanddler.pdfView = self.listView
         
         //TODO: 先让项目运行,看后面怎么调整这段逻辑,目前最外层是 KMBrowserWindowController
-        toolbarBox.contentView = toolbarController.view
+//        toolbarBox.contentView = toolbarController.view
         
-//        self.initToolbar()
+        self.initToolbar()
         
         if (UserDefaults.standard.object(forKey: CPDFOfficeLeftSidePaneWidthKey) != nil) {
             UserDefaults.standard.set(256, forKey: CPDFOfficeLeftSidePaneWidthKey)

+ 12 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_minus.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "toolbar_minus.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 71 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_minus.imageset/toolbar_minus.pdf

@@ -0,0 +1,71 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+-0.000000 -1.000000 1.000000 -0.000000 14.000000 11.000000 cm
+0.000000 0.000000 0.000000 scn
+0.000000 -10.000001 m
+0.000000 2.000000 l
+2.000000 2.000000 l
+2.000000 -10.000001 l
+0.000000 -10.000001 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  238
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000000328 00000 n
+0000000350 00000 n
+0000000523 00000 n
+0000000597 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+656
+%%EOF

+ 12 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_minus_dis.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "toolbar_minus_dis.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 71 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_minus_dis.imageset/toolbar_minus_dis.pdf

@@ -0,0 +1,71 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+-0.000000 -1.000000 1.000000 -0.000000 14.000000 11.000000 cm
+0.717647 0.729412 0.749020 scn
+0.000000 -10.000001 m
+0.000000 2.000000 l
+2.000000 2.000000 l
+2.000000 -10.000001 l
+0.000000 -10.000001 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  238
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000000328 00000 n
+0000000350 00000 n
+0000000523 00000 n
+0000000597 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+656
+%%EOF

+ 12 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_plus.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "toolbar_plus.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 79 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_plus.imageset/toolbar_plus.pdf

@@ -0,0 +1,79 @@
+%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 4.000000 4.000000 cm
+0.000000 0.000000 0.000000 scn
+5.000001 5.000000 m
+5.000001 -0.000001 l
+7.000001 -0.000001 l
+7.000001 5.000000 l
+12.000001 5.000000 l
+12.000001 7.000000 l
+7.000001 7.000000 l
+7.000001 12.000000 l
+5.000001 12.000000 l
+5.000001 7.000000 l
+0.000000 7.000000 l
+0.000000 5.000000 l
+5.000001 5.000000 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  394
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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 Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_plus_dis.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "toolbar_plus_dis.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 79 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_plus_dis.imageset/toolbar_plus_dis.pdf

@@ -0,0 +1,79 @@
+%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 4.000000 4.000000 cm
+0.717647 0.729412 0.749020 scn
+5.000001 5.000000 m
+5.000001 -0.000001 l
+7.000001 -0.000001 l
+7.000001 5.000000 l
+12.000001 5.000000 l
+12.000001 7.000000 l
+7.000001 7.000000 l
+7.000001 12.000000 l
+5.000001 12.000000 l
+5.000001 7.000000 l
+0.000000 7.000000 l
+0.000000 5.000000 l
+5.000001 5.000000 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  394
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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 Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_print.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "toolbar_print.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_print.imageset/toolbar_print.pdf


+ 12 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_redo.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "toolbar_redo.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 83 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_redo.imageset/toolbar_redo.pdf

@@ -0,0 +1,83 @@
+%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 17.828369 3.000000 cm
+0.062745 0.094118 0.156863 scn
+3.585766 8.999945 m
+4.535534 8.050177 l
+3.121320 6.635964 l
+0.292893 9.464391 l
+-0.097631 9.854916 -0.097631 10.488080 0.292893 10.878605 c
+3.121320 13.707031 l
+4.535534 12.292818 l
+3.242661 10.999945 l
+10.328432 10.999945 l
+13.365999 10.999945 15.828427 8.537509 15.828427 5.499945 c
+15.828427 2.462379 13.365993 -0.000055 10.328427 -0.000055 c
+0.828427 -0.000055 l
+0.828427 1.999945 l
+10.328427 1.999945 l
+12.261424 1.999945 13.828427 3.566948 13.828427 5.499945 c
+13.828427 7.432942 12.261427 8.999945 10.328432 8.999945 c
+3.585766 8.999945 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  677
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000000767 00000 n
+0000000789 00000 n
+0000000962 00000 n
+0000001036 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1095
+%%EOF

+ 12 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_rightView.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "toolbar_rightView.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 93 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_rightView.imageset/toolbar_rightView.pdf

@@ -0,0 +1,93 @@
+%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 0.000000 2.000000 cm
+0.062745 0.094118 0.156863 scn
+2.000000 14.000000 m
+2.000000 11.000000 l
+18.000000 11.000000 l
+18.000000 14.000000 l
+2.000000 14.000000 l
+h
+2.000000 2.000000 m
+2.000000 9.000000 l
+13.000000 9.000000 l
+13.000000 2.000000 l
+2.000000 2.000000 l
+h
+15.000000 2.000000 m
+18.000000 2.000000 l
+18.000000 9.000000 l
+15.000000 9.000000 l
+15.000000 2.000000 l
+h
+1.721014 16.000000 m
+0.770524 16.000000 0.000000 15.229476 0.000000 14.278986 c
+0.000000 1.721014 l
+0.000000 0.770524 0.770524 0.000000 1.721014 0.000000 c
+18.278986 0.000000 l
+19.229475 0.000000 20.000000 0.770524 20.000000 1.721014 c
+20.000000 14.278986 l
+20.000000 15.229476 19.229477 16.000000 18.278986 16.000000 c
+1.721014 16.000000 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  789
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000000879 00000 n
+0000000901 00000 n
+0000001074 00000 n
+0000001148 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1207
+%%EOF

+ 12 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_share.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "toolbar_share.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 95 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_share.imageset/toolbar_share.pdf

@@ -0,0 +1,95 @@
+%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 2.000000 2.000000 cm
+0.062745 0.094118 0.156863 scn
+13.085787 14.500000 m
+9.250000 14.500000 l
+9.250000 16.500000 l
+14.639493 16.500000 l
+15.667023 16.500000 16.500000 15.667022 16.500000 14.639493 c
+16.500000 9.250000 l
+14.500000 9.250000 l
+14.500000 13.085786 l
+9.136039 7.721826 l
+7.721826 9.136040 l
+13.085787 14.500000 l
+h
+2.250000 14.000000 m
+2.111929 14.000000 2.000000 13.888071 2.000000 13.750000 c
+2.000000 2.250000 l
+2.000000 2.111929 2.111929 2.000000 2.250000 2.000000 c
+13.750000 2.000000 l
+13.888071 2.000000 14.000000 2.111929 14.000000 2.250000 c
+14.000000 7.125000 l
+16.000000 7.125000 l
+16.000000 2.250000 l
+16.000000 1.007359 14.992641 0.000000 13.750000 0.000000 c
+2.250000 0.000000 l
+1.007360 0.000000 0.000000 1.007359 0.000000 2.250000 c
+0.000000 13.750000 l
+0.000000 14.992640 1.007359 16.000000 2.250000 16.000000 c
+7.125000 16.000000 l
+7.125000 14.000000 l
+2.250000 14.000000 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  981
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000001071 00000 n
+0000001093 00000 n
+0000001266 00000 n
+0000001340 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1399
+%%EOF

+ 12 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_undo.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "toolbar_undo.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 83 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_undo.imageset/toolbar_undo.pdf

@@ -0,0 +1,83 @@
+%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 2.171631 3.000000 cm
+0.062745 0.094118 0.156863 scn
+3.585789 8.999922 m
+4.535534 8.050177 l
+3.121320 6.635964 l
+0.292893 9.464391 l
+-0.097631 9.854916 -0.097631 10.488080 0.292893 10.878605 c
+3.121320 13.707031 l
+4.535534 12.292818 l
+3.242638 10.999922 l
+10.328245 10.999922 l
+13.365812 10.999922 15.828241 8.537487 15.828241 5.499922 c
+15.828241 2.462357 13.365807 -0.000078 10.328241 -0.000078 c
+0.828241 -0.000078 l
+0.828241 1.999922 l
+10.328241 1.999922 l
+12.261238 1.999922 13.828241 3.566925 13.828241 5.499922 c
+13.828241 7.432920 12.261240 8.999922 10.328245 8.999922 c
+3.585789 8.999922 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  674
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000000764 00000 n
+0000000786 00000 n
+0000000959 00000 n
+0000001033 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1092
+%%EOF

+ 12 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_zoom_dropdown.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "toolbar_zoom_dropdown.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 76 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/toolbar_zoom_dropdown.imageset/toolbar_zoom_dropdown.pdf

@@ -0,0 +1,76 @@
+%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 3.333344 5.203156 cm
+0.533333 0.549020 0.580392 scn
+0.195262 5.268254 m
+0.455612 5.528604 0.877722 5.528604 1.138071 5.268254 c
+4.666667 1.739658 l
+8.195263 5.268254 l
+8.455612 5.528604 8.877722 5.528604 9.138071 5.268254 c
+9.398421 5.007905 9.398421 4.585794 9.138071 4.325445 c
+5.138071 0.325445 l
+4.877722 0.065095 4.455612 0.065095 4.195262 0.325445 c
+0.195262 4.325445 l
+-0.065087 4.585794 -0.065087 5.007905 0.195262 5.268254 c
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  510
+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
+0000000600 00000 n
+0000000622 00000 n
+0000000795 00000 n
+0000000869 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+928
+%%EOF

+ 33 - 2
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFView/Toolbar/KMPDFToolbarController.swift

@@ -8,9 +8,9 @@
 import Cocoa
 import KMComponentLibrary
 
-@objc public protocol KMPDFToolbarControllerDelegate: AnyObject {
+@objc protocol KMPDFToolbarControllerDelegate: AnyObject {
     
-//    @objc optional func kmPDFToolbarControllerDidClicked(_ controller: KMPDFToolbarController, )
+    @objc optional func kmPDFToolbarControllerDidClicked(_ controller: KMPDFToolbarController)
  
 }
 
@@ -42,6 +42,16 @@ class KMPDFToolbarController: NSViewController {
         
         toolsView.properties = KMPDFToolbarManager.manager.toolsProperty
         toolsView.delegate = self
+     
+        selectZoom.properties = KMPDFToolbarManager.manager.selectZoomProperty
+        selectZoom.delegate = self
+        
+        tabsView.updateItemProperty([KMPDFToolbarManager.manager.markupMode_Property, KMPDFToolbarManager.manager.editMode_Property,
+                                     KMPDFToolbarManager.manager.formMode_Property, KMPDFToolbarManager.manager.fillMode_Property,
+                                     KMPDFToolbarManager.manager.convertMode_Property, KMPDFToolbarManager.manager.protectMode_Property,
+                                     KMPDFToolbarManager.manager.toolsMode_Property])
+        tabsView.delegate = self
+        
         
     }
     
@@ -82,3 +92,24 @@ extension KMPDFToolbarController: ComponentDropdownToolDelegate {
         reloadToolsData()
     }
 }
+
+
+//MARK: - ComponentSelectZoomDelegate
+extension KMPDFToolbarController: ComponentSelectZoomDelegate {
+    func componentSelectZoomDidReduce(view: ComponentSelectZoom) {
+        
+    }
+    
+    func componentSelectZoomDidSelect(view: ComponentSelectZoom?, menuItemProperty: ComponentMenuitemProperty?) {
+        
+    }
+    
+    func componentSelectZoomDidAdd(view: ComponentSelectZoom) {
+        
+    }
+}
+
+//MARK: - ComponentTabsDelegate
+extension KMPDFToolbarController: ComponentTabsDelegate {
+    
+}

+ 42 - 1
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFView/Toolbar/KMPDFToolbarManager.swift

@@ -13,6 +13,10 @@ class KMPDFToolbarManager: NSObject {
     
     var toolsType: KMPDFViewToolsType = .Select
     
+    
+    
+    
+    
     var viewProperty: ComponentButtonProperty = ComponentButtonProperty(type: .text_gray_opacity, size: .xs, onlyIcon: true)
     
     var pageProperty: ComponentButtonProperty = ComponentButtonProperty(type: .text_gray_opacity, size: .xs, onlyIcon: true)
@@ -24,7 +28,24 @@ class KMPDFToolbarManager: NSObject {
      var tools_magnifyProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, itemSelected: false, isDisabled: false, lefticon: NSImage(named: "toolbar_Tools_magnify"), keyEquivalent: KMLocalizedString("⌘ 4"), text: KMLocalizedString("Magnify"))
      var tools_areaProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, itemSelected: false, isDisabled: false, lefticon: NSImage(named: "toolbar_Tools_zoom"), keyEquivalent: KMLocalizedString("⌘ 5"), text: KMLocalizedString("Area Zoom"))
     
-    var selectZoomProperty: ComponentSelectZoomProperty = ComponentSelectZoomProperty(state: .normal, isDisabled: false, text: "100%")
+    var selectZoomProperty: ComponentSelectZoomProperty = ComponentSelectZoomProperty(state: .normal, isDisabled: false, text: "100%", leftIcon_nor: NSImage(named: "toolbar_minus"), leftIcon_dis: NSImage(named: "toolbar_minus_dis"), dropdownIcon: NSImage(named: "toolbar_zoom_dropdown"), rightIcon_nor: NSImage(named: "toolbar_plus"), rightIcon_dis: NSImage(named: "toolbar_plus_dis"))
+    
+    //Tabs
+    let markupMode_Property = ComponentTabsProperty(tabsType: .underline_Center, state: .normal, showIcon: false, title: NSLocalizedString("Markup", comment: ""))
+    let editMode_Property = ComponentTabsProperty(tabsType: .underline_Center, state: .normal, showIcon: false, title: NSLocalizedString("Edit", comment: ""))
+    let formMode_Property = ComponentTabsProperty(tabsType: .underline_Center, state: .normal, showIcon: false, title: NSLocalizedString("Form", comment: ""))
+    let fillMode_Property = ComponentTabsProperty(tabsType: .underline_Center, state: .normal, showIcon: false, title: NSLocalizedString("Fill", comment: ""))
+    let convertMode_Property = ComponentTabsProperty(tabsType: .underline_Center, state: .normal, showIcon: false, title: NSLocalizedString("Convert", comment: ""))
+    let protectMode_Property = ComponentTabsProperty(tabsType: .underline_Center, state: .normal, showIcon: false, title: NSLocalizedString("Protect", comment: ""))
+    let toolsMode_Property = ComponentTabsProperty(tabsType: .underline_Center, state: .normal, showIcon: false, title: NSLocalizedString("Tools", comment: ""))
+    
+    //Right
+    var undoProperty: ComponentButtonProperty = ComponentButtonProperty(type: .text_gray_opacity, size: .xs, onlyIcon: true)
+    var redoProperty: ComponentButtonProperty = ComponentButtonProperty(type: .text_gray_opacity, size: .xs, onlyIcon: true)
+    var printProperty: ComponentButtonProperty = ComponentButtonProperty(type: .text_gray_opacity, size: .xs, onlyIcon: true)
+    var shareProperty: ComponentButtonProperty = ComponentButtonProperty(type: .text_gray_opacity, size: .xs, onlyIcon: true)
+    var rightViewProperty: ComponentButtonProperty = ComponentButtonProperty(type: .text_gray_opacity, size: .xs, onlyIcon: true)
+    
     
     override init() {
         super.init()
@@ -49,6 +70,26 @@ class KMPDFToolbarManager: NSObject {
             toolsProperty.menuItemArr = menuItemArr
         }
          
+        if true {
+            var menuItemArr: [ComponentMenuitemProperty] = []
+            for string in ["Adaptation Width", "Adapt to Page", "Actual Size", " ",
+                           "10%", "25%", "50%", "75%", "100%", "150%", "200%", "400%", "800%"] {
+                
+                var itemProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, itemSelected: false, isDisabled: false, keyEquivalent: nil, text: KMLocalizedString(string, comment: ""))
+                if string == " " {
+                    itemProperty = ComponentMenuitemProperty.divider()
+                }
+                menuItemArr.append(itemProperty)
+            }
+            selectZoomProperty.menuItemArr = menuItemArr
+        }
+        
+        undoProperty.propertyInfo.leftIcon_nor = NSImage(named: "toolbar_undo")
+        redoProperty.propertyInfo.leftIcon_nor = NSImage(named: "toolbar_redo")
+        printProperty.propertyInfo.leftIcon_nor = NSImage(named: "toolbar_print")
+        shareProperty.propertyInfo.leftIcon_nor = NSImage(named: "toolbar_share")
+        rightViewProperty.propertyInfo.leftIcon_nor = NSImage(named: "toolbar_rightView")
+        
     }
     
     

+ 1 - 12
PDF Office/PDF Master/KMClass/Settings/SettingsDisplayView.swift

@@ -164,18 +164,7 @@ class SettingsDisplayView: BaseXibView {
                                                               creatable: false,
                                                               text: KMLocalizedString("Adaptation Width", comment: ""))
         if true {
-            var menuItemArr: [ComponentMenuitemProperty] = []
-            for string in ["Adaptation Width", "Adapt to Page", "Actual Size", " ",
-                           "10%", "25%", "50%", "75%", "100%", "150%", "200%", "400%", "800%"] {
-                
-                var itemProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, itemSelected: false, isDisabled: false, keyEquivalent: nil, text: KMLocalizedString(string, comment: ""))
-                if string == " " {
-                    itemProperty = ComponentMenuitemProperty.divider()
-                }
-                menuItemArr.append(itemProperty)
-            }
-            
-            zoomSelectView.updateMenuItemsArr(menuItemArr)
+            zoomSelectView.updateMenuItemsArr(KMPDFToolbarManager.manager.selectZoomProperty.menuItemArr)
             zoomSelectView.delegate = self
         }