Prechádzať zdrojové kódy

【EditPDF】内容编辑悬浮窗口颜色视图补充交互

tangchao 8 mesiacov pred
rodič
commit
60de75a6c3

+ 16 - 271
PDF Office/PDF Master/Class/PDFTools/EditPDF/Controller/KMEditPDFPopToolBarController.swift

@@ -67,277 +67,6 @@ struct KMEditPDFToolbarStyle: OptionSet {
     static var image   = KMEditPDFToolbarStyle(rawValue: 1 << 1)
 }
 
-class KMEditPDFToolbarItemView: NSView {
-    private lazy var contentBox_: NSBox = {
-        let view = NSBox()
-        view.boxType = .custom
-        view.titlePosition = .noTitle
-        view.contentViewMargins = .zero
-        view.borderWidth = 0
-        return view
-    }()
-    
-    var view: NSView? {
-        didSet {
-            if let data = self.view {
-                self.contentBox_.contentView = data
-            }
-            
-            self.needsLayout = true
-        }
-    }
-    
-    var obj: AnyObject?
-    
-    convenience init() {
-        self.init(frame: .zero)
-        self.addSubview(self.contentBox_)
-    }
-    
-    override func layout() {
-        super.layout()
-        
-        let height = NSHeight(self.bounds)
-        let width = NSWidth(self.bounds)
-//        let boxFrame = self.contentBox_.contentView?.frame ?? .zero
-//        let boxX = (width - boxFrame.size.width) * 0.5
-//        let boxY = (height - boxFrame.size.height) * 0.5
-//        self.contentBox_.frame = NSMakeRect(boxX, boxY, boxFrame.size.width, boxFrame.size.height)
-        self.contentBox_.frame = self.bounds
-        
-//        KMPrint("-------- \(boxFrame)")
-    }
-}
-
-class KMEditPDFColorView: NSView {
-    lazy var box: NSBox = {
-        let view = NSBox()
-        view.boxType = .custom
-        view.titlePosition = .noTitle
-        view.contentViewMargins = .zero
-        view.borderWidth = 1
-        view.cornerRadius = 4
-        view.borderColor = NSColor(hex: "#DFE1E5")
-        return view
-    }()
-    
-    lazy var colorBtn: NSButton = {
-        let view = NSButton()
-        view.isBordered = false
-        view.title = ""
-        view.wantsLayer = true
-        view.layer?.cornerRadius = 10
-        
-        view.layer?.backgroundColor = .black
-        view.target = self
-        view.action = #selector(buttonClick)
-        return view
-    }()
-    
-    lazy var plateBtn: NSButton = {
-        let view = NSButton()
-        view.isBordered = false
-        view.title = ""
-        view.wantsLayer = true
-        view.layer?.cornerRadius = 10
-        view.layer?.masksToBounds = true
-        view.image = NSImage(named: "view_color")
-        return view
-    }()
-    
-    override init(frame frameRect: NSRect) {
-        super.init(frame: frameRect)
-        
-        self.initSubView()
-    }
-    
-    required init?(coder: NSCoder) {
-        super.init(coder: coder)
-        
-        self.initSubView()
-    }
-    
-    convenience init() {
-        self.init(frame: .init(x: 0, y: 0, width: 56, height: 32))
-    }
-    
-    func initSubView() {
-        self.addSubview(self.box)
-        self.box.contentView?.addSubview(self.colorBtn)
-        self.box.contentView?.addSubview(self.plateBtn)
-    }
-    
-    override func layout() {
-        super.layout()
-        
-        let height = NSHeight(self.bounds)
-        self.box.frame = self.bounds
-        
-        let btnWH: CGFloat = 20
-        let btnY: CGFloat = (height - btnWH) * 0.5
-        let colorX: CGFloat = 4
-        self.colorBtn.frame = NSMakeRect(colorX, btnY, btnWH, btnWH)
-        
-        let plateX: CGFloat = NSMaxX(self.colorBtn.frame) + 8
-        self.plateBtn.frame = NSMakeRect(plateX, btnY, btnWH, btnWH)
-    }
-    
-    @objc func buttonClick(_ sender: NSButton) {
-        
-    }
-}
-
-@objc protocol KMEditPDFToolbarViewDelegate: NSObjectProtocol {
-    @objc optional func numberOfItems(in toolbarView: KMEditPDFToolbarView) -> Int
-    @objc optional func toolbarView(_ toolbarView: KMEditPDFToolbarView, viewFor index: Int) -> NSView?
-    
-    @objc optional func toolbarView(_ toolbarView: KMEditPDFToolbarView, sizeForItemAt index: Int) -> NSSize
-
-//    @objc optional func toolbarView(_ toolbarView: KMEditPDFToolbarView, insetForSectionAt section: Int) -> NSEdgeInsets
-//    @objc optional func toolbarView(_ toolbarView: KMEditPDFToolbarView, minimumLineSpacingForSectionAt section: Int) -> CGFloat
-//    @objc optional func toolbarView(_ toolbarView: KMEditPDFToolbarView, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat
-}
-
-class KMEditPDFToolbarView: NSView {
-    weak var delegate: KMEditPDFToolbarViewDelegate?
-    
-    convenience init() {
-        self.init(frame: .zero)
-    }
-    
-    var inset: NSEdgeInsets = NSEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) {
-        didSet {
-            self.needsLayout = true
-        }
-    }
-    
-    func reloadData() {
-        for sv in self.subviews {
-            sv.removeFromSuperview()
-        }
-        
-        guard let num = self.delegate?.numberOfItems?(in: self) else {
-            return
-        }
-        for i in 0 ..< num {
-            if let view = self.delegate?.toolbarView?(self, viewFor: i) {
-                self.addSubview(view)
-            }
-        }
-        
-        self.needsLayout = true
-    }
-    
-    override func layout() {
-        super.layout()
-        
-        let height = NSHeight(self.bounds)
-        
-        let leftMargin = self.inset.left
-        let topMargin = self.inset.top
-        var x = leftMargin
-        let vSpace: CGFloat = 2
-        for (i, sv) in self.subviews.enumerated() {
-            if let size = self.delegate?.toolbarView?(self, sizeForItemAt: i) {
-                let y = topMargin
-                var frame = NSRect(x: x, y: y, width: size.width, height: size.height)
-                x += (size.width + vSpace)
-                sv.frame = frame
-            }
-        }
-    }
-}
-
-@objcMembers class KMEditPDFPopToolBarWindow: NSWindow {
-    static let shared = KMEditPDFPopToolBarWindow()
-    
-    var style: KMEditPDFToolbarStyle = .text
-    var isMultiple: Bool = false
-    
-    var itemClick: ((KMEditPDFToolbarItemKey, Any?)->Void)?
-    
-    convenience init() {
-        let rect = NSRect(x: 0, y: 0, width: 400, height: 44)
-        let styleMask: NSWindow.StyleMask = [.fullSizeContentView]
-        self.init(contentRect: rect, styleMask: styleMask, backing: .buffered, defer: false)
-    }
-    
-    override init(contentRect: NSRect, styleMask style: NSWindow.StyleMask, backing backingStoreType: NSWindow.BackingStoreType, defer flag: Bool) {
-        super.init(contentRect: contentRect, styleMask: style, backing: backingStoreType, defer: flag)
-        
-        let contentViewC = KMEditPDFPopToolBarController()
-        self.contentViewController = contentViewC
-        
-        self.titlebarAppearsTransparent = true
-        self.titleVisibility = .hidden
-//        self.level = .popUpMenu
-//        self.isMovableByWindowBackground = false
-        self.isMovable = false
-        
-        self.contentView?.wantsLayer = true
-        self.contentView?.layer?.cornerRadius = 4
-        self.contentView?.layer?.masksToBounds = true
-        
-        self.backgroundColor = .clear
-        
-        contentViewC.itemClick = { [weak self] itemKey, obj in
-            self?.itemClick?(itemKey, obj)
-        }
-    }
-    
-    func show(relativeTo positioningRect: NSRect, of positioningView: NSView, preferredEdge: NSRectEdge) {
-        let contentViewC = (self.contentViewController as? KMEditPDFPopToolBarController)
-        
-        var width: CGFloat = 392
-        if self.style.contains(.text) {
-            if self.style.contains(.image) { // text + image
-                contentViewC?.itemKeys = [.alignmentLeft, .alignmentCenterX, .alignmentRight, .alignmentjustifiedX, .alignmentTop, .alignmentCenterY, .alignmentBottom, .alignmentjustifiedY]
-                width = 320
-            } else { // text
-                if self.isMultiple {
-                    width = 478
-                    contentViewC?.itemKeys = [.color, .fontStyle, .fontAdd, .fontReduce, .fontBold, .fontItalic, .textAlignment, .separator, .alignmentLeft, .alignmentTop]
-                } else {
-                    width = 392
-                    contentViewC?.itemKeys = [.color, .fontStyle, .fontAdd, .fontReduce, .fontBold, .fontItalic, .textAlignment]
-                }
-            }
-        } else {
-            if self.style.contains(.image) { // image
-                if self.isMultiple {
-                    width = 396
-                    contentViewC?.itemKeys = [.leftRotate, .rightRotate, .separator, .reverseX, .reverseY, .separator, .crop, .replace, .export, .separator, .alignmentLeft, .alignmentTop]
-                } else {
-                    width = 304
-                    contentViewC?.itemKeys = [.leftRotate, .rightRotate, .separator, .reverseX, .reverseY, .separator, .crop, .replace, .export]
-                }
-            } else { // none
-                
-            }
-        }
-        
-//        var position = positioningView.convert(positioningRect.origin, to: nil)
-        var position = NSEvent.mouseLocation
-        position.y += 20
-        position.x -= 60
-//        self.setFrameOrigin(position)
-        let frame = NSMakeRect(position.x, position.y, width, 44)
-        self.setFrame(frame, display: true)
-        
-        self.contentViewController?.view.frame = NSMakeRect(0, 0, width, 44)
-        self.orderFront(nil)
-//        self.makeKeyAndOrderFront(nil)
-    }
-    
-    override var isMainWindow: Bool {
-        return true
-    }
-    
-    override var isKeyWindow: Bool {
-        return true
-    }
-}
-
 class KMEditPDFPopToolBarController: NSViewController {
     deinit {
         KMPrint("KMEditPDFPopToolBarController deinit.")
@@ -354,6 +83,8 @@ class KMEditPDFPopToolBarController: NSViewController {
         }
     }
     
+    var fontColor: NSColor?
+    
     var itemClick: ((KMEditPDFToolbarItemKey, Any?)->Void)?
     
     override func viewDidLoad() {
@@ -380,6 +111,13 @@ class KMEditPDFPopToolBarController: NSViewController {
             self.itemClick?(self.itemKeys[idx], nil)
         }
     }
+    
+    @objc func colorPanelAction(_ sender: NSColorPanel) {
+        let color = sender.color
+        let colorView = (self.toolbarView?.itemViews.first as? KMEditPDFToolbarItemView)?.view as? KMEditPDFColorView
+        colorView?.colorBtn.layer?.backgroundColor = color.cgColor
+        self.itemClick?(.color, color)
+    }
 }
 
 extension KMEditPDFPopToolBarController: KMEditPDFToolbarViewDelegate {
@@ -392,6 +130,13 @@ extension KMEditPDFPopToolBarController: KMEditPDFToolbarViewDelegate {
         if itemKey == .color {
             let colorView = KMEditPDFToolbarItemView()
             let view = KMEditPDFColorView()
+            view.colorBtn.layer?.backgroundColor = self.fontColor?.cgColor
+            view.itemClick = { [weak self] idx, _ in
+                let panel = NSColorPanel.shared
+                panel.setTarget(self)
+                panel.setAction(#selector(self?.colorPanelAction))
+                panel.orderFront(nil)
+            }
             colorView.view = view
             return colorView
         } else if itemKey == .fontStyle {

+ 57 - 0
PDF Office/PDF Master/Class/PDFTools/EditPDF/Model/KMEditPDFModel.swift

@@ -0,0 +1,57 @@
+//
+//  KMEditPDFModel.swift
+//  PDF Reader Pro
+//
+//  Created by tangchao on 2024/6/25.
+//
+
+import Cocoa
+
+class KMEditPDFModel: NSObject {
+//
+//    var cFont: CPDFFont?
+    var editingAreas: [CPDFEditArea]?
+    
+    var textAreas: [CPDFEditTextArea]? {
+        get {
+            guard let areas = self.editingAreas else {
+                return nil
+            }
+            var datas: [CPDFEditTextArea] = []
+            for area in areas {
+                if let data = area as? CPDFEditTextArea {
+                    datas.append(data)
+                    continue
+                }
+            }
+            return datas
+        }
+    }
+    
+    var imageAreas: [CPDFEditImageArea]? {
+        get {
+            guard let areas = self.editingAreas else {
+                return nil
+            }
+            var datas: [CPDFEditImageArea] = []
+            for area in areas {
+                if let data = area as? CPDFEditImageArea {
+                    datas.append(data)
+                    continue
+                }
+            }
+            return datas
+        }
+    }
+    
+    var fontColors: [NSColor] = []
+//        get {
+//            guard let textAreas = self.textAreas else {
+//                return nil
+//            }
+//            for area in textAreas {
+//
+//            }
+//        }
+//    }
+}

+ 50 - 0
PDF Office/PDF Master/Class/PDFTools/EditPDF/Toolbar/KMEditPDFToolbarItemView.swift

@@ -0,0 +1,50 @@
+//
+//  KMEditPDFToolbarItemView.swift
+//  PDF Reader Pro
+//
+//  Created by tangchao on 2024/6/25.
+//
+
+import Cocoa
+
+class KMEditPDFToolbarItemView: NSView {
+    private lazy var contentBox_: NSBox = {
+        let view = NSBox()
+        view.boxType = .custom
+        view.titlePosition = .noTitle
+        view.contentViewMargins = .zero
+        view.borderWidth = 0
+        return view
+    }()
+    
+    var view: NSView? {
+        didSet {
+            if let data = self.view {
+                self.contentBox_.contentView = data
+            }
+            
+            self.needsLayout = true
+        }
+    }
+    
+    var obj: AnyObject?
+    
+    convenience init() {
+        self.init(frame: .zero)
+        self.addSubview(self.contentBox_)
+    }
+    
+    override func layout() {
+        super.layout()
+        
+        let height = NSHeight(self.bounds)
+        let width = NSWidth(self.bounds)
+//        let boxFrame = self.contentBox_.contentView?.frame ?? .zero
+//        let boxX = (width - boxFrame.size.width) * 0.5
+//        let boxY = (height - boxFrame.size.height) * 0.5
+//        self.contentBox_.frame = NSMakeRect(boxX, boxY, boxFrame.size.width, boxFrame.size.height)
+        self.contentBox_.frame = self.bounds
+        
+//        KMPrint("-------- \(boxFrame)")
+    }
+}

+ 74 - 0
PDF Office/PDF Master/Class/PDFTools/EditPDF/Toolbar/KMEditPDFToolbarView.swift

@@ -0,0 +1,74 @@
+//
+//  KMEditPDFToolbarView.swift
+//  PDF Reader Pro
+//
+//  Created by tangchao on 2024/6/25.
+//
+
+import Cocoa
+
+@objc protocol KMEditPDFToolbarViewDelegate: NSObjectProtocol {
+    @objc optional func numberOfItems(in toolbarView: KMEditPDFToolbarView) -> Int
+    @objc optional func toolbarView(_ toolbarView: KMEditPDFToolbarView, viewFor index: Int) -> NSView?
+    
+    @objc optional func toolbarView(_ toolbarView: KMEditPDFToolbarView, sizeForItemAt index: Int) -> NSSize
+
+//    @objc optional func toolbarView(_ toolbarView: KMEditPDFToolbarView, insetForSectionAt section: Int) -> NSEdgeInsets
+//    @objc optional func toolbarView(_ toolbarView: KMEditPDFToolbarView, minimumLineSpacingForSectionAt section: Int) -> CGFloat
+//    @objc optional func toolbarView(_ toolbarView: KMEditPDFToolbarView, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat
+}
+
+class KMEditPDFToolbarView: NSView {
+    weak var delegate: KMEditPDFToolbarViewDelegate?
+    
+    var itemViews: [NSView] = []
+    
+    convenience init() {
+        self.init(frame: .zero)
+    }
+    
+    var inset: NSEdgeInsets = NSEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) {
+        didSet {
+            self.needsLayout = true
+        }
+    }
+    
+    func reloadData() {
+        for sv in self.subviews {
+            sv.removeFromSuperview()
+        }
+        self.itemViews.removeAll()
+        
+        guard let num = self.delegate?.numberOfItems?(in: self) else {
+            return
+        }
+        for i in 0 ..< num {
+            if let view = self.delegate?.toolbarView?(self, viewFor: i) {
+                self.addSubview(view)
+                self.itemViews.append(view)
+            }
+        }
+        
+        self.needsLayout = true
+    }
+    
+    override func layout() {
+        super.layout()
+        
+        let height = NSHeight(self.bounds)
+        
+        let leftMargin = self.inset.left
+        let topMargin = self.inset.top
+        var x = leftMargin
+        let vSpace: CGFloat = 2
+        for (i, sv) in self.subviews.enumerated() {
+            if let size = self.delegate?.toolbarView?(self, sizeForItemAt: i) {
+                let y = topMargin
+                var frame = NSRect(x: x, y: y, width: size.width, height: size.height)
+                x += (size.width + vSpace)
+                sv.frame = frame
+            }
+        }
+    }
+}
+

+ 46 - 22
PDF Office/PDF Master/Class/PDFTools/EditPDF/Tools/KMEditPDfHanddler.swift

@@ -101,6 +101,18 @@ class KMEditPDfHanddler: NSObject {
         self.editingConfig?.isDrawRectWithDot = true
     }
     
+    func fontColorAction(color: NSColor?) {
+        guard let theColor = color else {
+            return
+        }
+        let editingAreas = self.editingAreas
+        for area in editingAreas {
+            if let data = area as? CPDFEditTextArea {
+                self.listView?.setEditingSelectionFontColor(theColor, with: data)
+            }
+        }
+    }
+    
     func fontAddAction() {
         let editingAreas = self.editingAreas
         if editingAreas.isEmpty {
@@ -332,13 +344,21 @@ class KMEditPDfHanddler: NSObject {
         }
         
         let win = KMEditPDFPopToolBarWindow.shared
+        let contains = self.viewC?.view.window?.childWindows?.contains(win) ?? false
+        if contains {
+            self.viewC?.view.window?.removeChildWindow(win)
+        }
         let areas = self.editingAreas
         win.isMultiple = areas.count > 1
         var hasText = false
         var hasImage = false
+        var fontColors: [NSColor] = []
         for area in areas {
-            if area is CPDFEditTextArea {
+            if let data = area as? CPDFEditTextArea {
                 hasText = true
+                if let color = self.listView?.editingSelectionFontColor(with: data) {
+                    fontColors.append(color)
+                }
             }
             if area is CPDFEditImageArea {
                 hasImage = true
@@ -352,11 +372,15 @@ class KMEditPDfHanddler: NSObject {
             style.insert(.image)
         }
         win.style = style
+        win.model.editingAreas = areas
+        win.model.fontColors = fontColors
         
         win.show(relativeTo: positionRect, of: self.viewC!.listView, preferredEdge: .maxY)
         self.viewC?.view.window?.addChildWindow(win, ordered: .above)
         win.itemClick = { [weak self] itemKey, obj in
-            if itemKey == .fontAdd {
+            if itemKey == .color {
+                self?.fontColorAction(color: obj as? NSColor)
+            } else if itemKey == .fontAdd {
                 self?.fontAddAction()
             } else if itemKey == .fontReduce {
                 self?.fontReduceAction()
@@ -412,26 +436,26 @@ class KMEditPDfHanddler: NSObject {
     func showGuideView(_ view: NSView) {
         DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
             if KMGuideInfoWindowController.availableShow(.editPDFPopWindow) {
-            var winFrame = self.viewC?.view.window?.frame ?? .zero
-            winFrame.size.height -= 20
-            
+                var winFrame = self.viewC?.view.window?.frame ?? .zero
+                winFrame.size.height -= 20
+                
                 let area = (self.listView?.editingAreas().first as? CPDFEditArea)
                 let areaBounds = (self.listView?.convert(area!.bounds, from: area!.page) as? NSRect) ?? .zero
-            
+                
                 let guideWC = KMGuideInfoWindowController.currentWC()
                 guideWC.type = .editPDFPopWindow
-            var viewFrame = areaBounds
-            let tmpY = areaBounds.origin.y+(areaBounds.size.height-KMEditPDFPopGuideView.kHeight+80)
-            if tmpY < 50 {
-                guideWC.editPDFPopWindowFlag = true
-                viewFrame.origin.y += (areaBounds.size.height)
-                viewFrame.origin.x += (areaBounds.size.width*0.5+KMEditPDFPopGuideView.kWidth*0.5)
-            } else {
-                guideWC.editPDFPopWindowFlag = false
-                viewFrame.origin.y += (areaBounds.size.height-KMEditPDFPopGuideView.kHeight+80)
-                viewFrame.origin.x += (areaBounds.size.width*0.5+KMEditPDFPopGuideView.kWidth*0.5)
-            }
-            
+                var viewFrame = areaBounds
+                let tmpY = areaBounds.origin.y+(areaBounds.size.height-KMEditPDFPopGuideView.kHeight+80)
+                if tmpY < 50 {
+                    guideWC.editPDFPopWindowFlag = true
+                    viewFrame.origin.y += (areaBounds.size.height)
+                    viewFrame.origin.x += (areaBounds.size.width*0.5+KMEditPDFPopGuideView.kWidth*0.5)
+                } else {
+                    guideWC.editPDFPopWindowFlag = false
+                    viewFrame.origin.y += (areaBounds.size.height-KMEditPDFPopGuideView.kHeight+80)
+                    viewFrame.origin.x += (areaBounds.size.width*0.5+KMEditPDFPopGuideView.kWidth*0.5)
+                }
+                
                 guideWC.digitalBoxRect = viewFrame
                 var beh = view.window?.collectionBehavior ?? []
                 beh.insert(.canJoinAllSpaces)
@@ -440,11 +464,11 @@ class KMEditPDfHanddler: NSObject {
                 guideWC.window?.setFrame(winFrame, display: false)
                 guideWC.window?.minSize = winFrame.size
                 guideWC.window?.maxSize = winFrame.size
-            self.viewC?.view.window?.addChildWindow(guideWC.window!, ordered: .above)
+                self.viewC?.view.window?.addChildWindow(guideWC.window!, ordered: .above)
                 guideWC.show()
-            DispatchQueue.main.async {
-                guideWC.interfaceThemeDidChanged(NSApp.appearance?.name ?? .aqua)
-            }
+                DispatchQueue.main.async {
+                    guideWC.interfaceThemeDidChanged(NSApp.appearance?.name ?? .aqua)
+                }
                 
                 guideWC.settingCallback = {
                     KMPreferenceController.shared.showWindow(nil)

+ 88 - 0
PDF Office/PDF Master/Class/PDFTools/EditPDF/View/KMEditPDFColorView.swift

@@ -0,0 +1,88 @@
+//
+//  KMEditPDFColorView.swift
+//  PDF Reader Pro
+//
+//  Created by tangchao on 2024/6/25.
+//
+
+import Cocoa
+
+class KMEditPDFColorView: NSView {
+    lazy var box: NSBox = {
+        let view = NSBox()
+        view.boxType = .custom
+        view.titlePosition = .noTitle
+        view.contentViewMargins = .zero
+        view.borderWidth = 1
+        view.cornerRadius = 4
+        view.borderColor = NSColor(hex: "#DFE1E5")
+        return view
+    }()
+    
+    lazy var colorBtn: NSButton = {
+        let view = NSButton()
+        view.isBordered = false
+        view.title = ""
+        view.wantsLayer = true
+        view.layer?.cornerRadius = 10
+        
+        view.layer?.backgroundColor = .black
+        return view
+    }()
+    
+    lazy var plateBtn: NSButton = {
+        let view = NSButton()
+        view.isBordered = false
+        view.title = ""
+        view.wantsLayer = true
+        view.layer?.cornerRadius = 10
+        view.layer?.masksToBounds = true
+        view.image = NSImage(named: "view_color")
+        view.target = self
+        view.action = #selector(buttonClick)
+        return view
+    }()
+    
+    var itemClick: KMCommonClickBlock?
+    
+    override init(frame frameRect: NSRect) {
+        super.init(frame: frameRect)
+        
+        self.initSubView()
+    }
+    
+    required init?(coder: NSCoder) {
+        super.init(coder: coder)
+        
+        self.initSubView()
+    }
+    
+    convenience init() {
+        self.init(frame: .init(x: 0, y: 0, width: 56, height: 32))
+    }
+    
+    func initSubView() {
+        self.addSubview(self.box)
+        self.box.contentView?.addSubview(self.colorBtn)
+        self.box.contentView?.addSubview(self.plateBtn)
+    }
+    
+    override func layout() {
+        super.layout()
+        
+        let height = NSHeight(self.bounds)
+        self.box.frame = self.bounds
+        
+        let btnWH: CGFloat = 20
+        let btnY: CGFloat = (height - btnWH) * 0.5
+        let colorX: CGFloat = 4
+        self.colorBtn.frame = NSMakeRect(colorX, btnY, btnWH, btnWH)
+        
+        let plateX: CGFloat = NSMaxX(self.colorBtn.frame) + 8
+        self.plateBtn.frame = NSMakeRect(plateX, btnY, btnWH, btnWH)
+    }
+    
+    @objc func buttonClick(_ sender: NSButton) {
+        self.itemClick?(0)
+    }
+}

+ 102 - 0
PDF Office/PDF Master/Class/PDFTools/EditPDF/Window/KMEditPDFPopToolBarWindow.swift

@@ -0,0 +1,102 @@
+//
+//  KMEditPDFPopToolBarWindow.swift
+//  PDF Reader Pro
+//
+//  Created by tangchao on 2024/6/25.
+//
+
+import Cocoa
+
+@objcMembers class KMEditPDFPopToolBarWindow: NSWindow {
+    static let shared = KMEditPDFPopToolBarWindow()
+    
+    var style: KMEditPDFToolbarStyle = .text
+    var isMultiple: Bool = false
+    
+    let model = KMEditPDFModel()
+    
+    var itemClick: ((KMEditPDFToolbarItemKey, Any?)->Void)?
+    
+    convenience init() {
+        let rect = NSRect(x: 0, y: 0, width: 400, height: 44)
+        let styleMask: NSWindow.StyleMask = [.fullSizeContentView]
+        self.init(contentRect: rect, styleMask: styleMask, backing: .buffered, defer: false)
+    }
+    
+    override init(contentRect: NSRect, styleMask style: NSWindow.StyleMask, backing backingStoreType: NSWindow.BackingStoreType, defer flag: Bool) {
+        super.init(contentRect: contentRect, styleMask: style, backing: backingStoreType, defer: flag)
+        
+        let contentViewC = KMEditPDFPopToolBarController()
+        self.contentViewController = contentViewC
+        
+        self.titlebarAppearsTransparent = true
+        self.titleVisibility = .hidden
+//        self.level = .popUpMenu
+//        self.isMovableByWindowBackground = false
+        self.isMovable = false
+        
+        self.contentView?.wantsLayer = true
+        self.contentView?.layer?.cornerRadius = 4
+        self.contentView?.layer?.masksToBounds = true
+        
+        self.backgroundColor = .clear
+        
+        contentViewC.itemClick = { [weak self] itemKey, obj in
+            self?.itemClick?(itemKey, obj)
+        }
+    }
+    
+    func show(relativeTo positioningRect: NSRect, of positioningView: NSView, preferredEdge: NSRectEdge) {
+        let contentViewC = (self.contentViewController as? KMEditPDFPopToolBarController)
+        
+        var width: CGFloat = 392
+        if self.style.contains(.text) {
+            if self.style.contains(.image) { // text + image
+                contentViewC?.itemKeys = [.alignmentLeft, .alignmentCenterX, .alignmentRight, .alignmentjustifiedX, .alignmentTop, .alignmentCenterY, .alignmentBottom, .alignmentjustifiedY]
+                width = 320
+            } else { // text
+                if self.isMultiple {
+                    width = 478
+                    contentViewC?.itemKeys = [.color, .fontStyle, .fontAdd, .fontReduce, .fontBold, .fontItalic, .textAlignment, .separator, .alignmentLeft, .alignmentTop]
+                } else {
+                    width = 392
+                    contentViewC?.itemKeys = [.color, .fontStyle, .fontAdd, .fontReduce, .fontBold, .fontItalic, .textAlignment]
+                }
+            }
+        } else {
+            if self.style.contains(.image) { // image
+                if self.isMultiple {
+                    width = 396
+                    contentViewC?.itemKeys = [.leftRotate, .rightRotate, .separator, .reverseX, .reverseY, .separator, .crop, .replace, .export, .separator, .alignmentLeft, .alignmentTop]
+                } else {
+                    width = 304
+                    contentViewC?.itemKeys = [.leftRotate, .rightRotate, .separator, .reverseX, .reverseY, .separator, .crop, .replace, .export]
+                }
+            } else { // none
+                
+            }
+        }
+        contentViewC?.fontColor = self.model.fontColors.last ?? .black
+        
+//        var position = positioningView.convert(positioningRect.origin, to: nil)
+        var position = NSEvent.mouseLocation
+        position.y += 20
+        position.x -= 60
+//        self.setFrameOrigin(position)
+        let frame = NSMakeRect(position.x, position.y, width, 44)
+        self.setFrame(frame, display: true)
+        
+        self.contentViewController?.view.frame = NSMakeRect(0, 0, width, 44)
+        self.orderFront(nil)
+//        self.makeKeyAndOrderFront(nil)
+    }
+    
+    override var isMainWindow: Bool {
+        return true
+    }
+    
+    override var isKeyWindow: Bool {
+        return true
+    }
+}
+

+ 56 - 0
PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj

@@ -3821,6 +3821,21 @@
 		BB6EA2A62B70B8F3000D4490 /* KMConvertComparePayViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BB6EA2A22B70B8F2000D4490 /* KMConvertComparePayViewController.m */; };
 		BB6EA2A72B70B8F3000D4490 /* KMConvertComparePayViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BB6EA2A22B70B8F2000D4490 /* KMConvertComparePayViewController.m */; };
 		BB6EA2A82B70B8F3000D4490 /* KMConvertComparePayViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BB6EA2A22B70B8F2000D4490 /* KMConvertComparePayViewController.m */; };
+		BB7185382C2B0A1100C1156B /* KMEditPDFPopToolBarWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7185372C2B0A1100C1156B /* KMEditPDFPopToolBarWindow.swift */; };
+		BB7185392C2B0A1100C1156B /* KMEditPDFPopToolBarWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7185372C2B0A1100C1156B /* KMEditPDFPopToolBarWindow.swift */; };
+		BB71853A2C2B0A1100C1156B /* KMEditPDFPopToolBarWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7185372C2B0A1100C1156B /* KMEditPDFPopToolBarWindow.swift */; };
+		BB71853D2C2B0A7C00C1156B /* KMEditPDFToolbarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB71853C2C2B0A7C00C1156B /* KMEditPDFToolbarView.swift */; };
+		BB71853E2C2B0A7C00C1156B /* KMEditPDFToolbarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB71853C2C2B0A7C00C1156B /* KMEditPDFToolbarView.swift */; };
+		BB71853F2C2B0A7C00C1156B /* KMEditPDFToolbarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB71853C2C2B0A7C00C1156B /* KMEditPDFToolbarView.swift */; };
+		BB7185412C2B0AAF00C1156B /* KMEditPDFToolbarItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7185402C2B0AAF00C1156B /* KMEditPDFToolbarItemView.swift */; };
+		BB7185422C2B0AAF00C1156B /* KMEditPDFToolbarItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7185402C2B0AAF00C1156B /* KMEditPDFToolbarItemView.swift */; };
+		BB7185432C2B0AAF00C1156B /* KMEditPDFToolbarItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7185402C2B0AAF00C1156B /* KMEditPDFToolbarItemView.swift */; };
+		BB7185452C2B0AFD00C1156B /* KMEditPDFColorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7185442C2B0AFC00C1156B /* KMEditPDFColorView.swift */; };
+		BB7185462C2B0AFD00C1156B /* KMEditPDFColorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7185442C2B0AFC00C1156B /* KMEditPDFColorView.swift */; };
+		BB7185472C2B0AFD00C1156B /* KMEditPDFColorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7185442C2B0AFC00C1156B /* KMEditPDFColorView.swift */; };
+		BB71854A2C2B0DC500C1156B /* KMEditPDFModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7185492C2B0DC500C1156B /* KMEditPDFModel.swift */; };
+		BB71854B2C2B0DC500C1156B /* KMEditPDFModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7185492C2B0DC500C1156B /* KMEditPDFModel.swift */; };
+		BB71854C2C2B0DC500C1156B /* KMEditPDFModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7185492C2B0DC500C1156B /* KMEditPDFModel.swift */; };
 		BB7289E02B8838D8004B53B5 /* KMDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7289DF2B8838D8004B53B5 /* KMDataManager.swift */; };
 		BB7289E12B8838D8004B53B5 /* KMDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7289DF2B8838D8004B53B5 /* KMDataManager.swift */; };
 		BB7289E22B8838D8004B53B5 /* KMDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7289DF2B8838D8004B53B5 /* KMDataManager.swift */; };
@@ -6840,6 +6855,11 @@
 		BB6EA2A02B70B8EF000D4490 /* KMConvertComparePayViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KMConvertComparePayViewController.h; sourceTree = "<group>"; };
 		BB6EA2A12B70B8F1000D4490 /* KMConvertComparePayViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMConvertComparePayViewController.xib; sourceTree = "<group>"; };
 		BB6EA2A22B70B8F2000D4490 /* KMConvertComparePayViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KMConvertComparePayViewController.m; sourceTree = "<group>"; };
+		BB7185372C2B0A1100C1156B /* KMEditPDFPopToolBarWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMEditPDFPopToolBarWindow.swift; sourceTree = "<group>"; };
+		BB71853C2C2B0A7C00C1156B /* KMEditPDFToolbarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMEditPDFToolbarView.swift; sourceTree = "<group>"; };
+		BB7185402C2B0AAF00C1156B /* KMEditPDFToolbarItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMEditPDFToolbarItemView.swift; sourceTree = "<group>"; };
+		BB7185442C2B0AFC00C1156B /* KMEditPDFColorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMEditPDFColorView.swift; sourceTree = "<group>"; };
+		BB7185492C2B0DC500C1156B /* KMEditPDFModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMEditPDFModel.swift; sourceTree = "<group>"; };
 		BB7289DF2B8838D8004B53B5 /* KMDataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMDataManager.swift; sourceTree = "<group>"; };
 		BB7289E42B8844BA004B53B5 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
 		BB74DA762AC41182006EDFE7 /* NSFont+KMExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSFont+KMExtension.swift"; sourceTree = "<group>"; };
@@ -11938,6 +11958,7 @@
 			children = (
 				BB4D02A82C22D17B0001474A /* KMEditPDFPopGuideView.swift */,
 				BB6985582C2A94BD007D307D /* KMGuideTargetView.swift */,
+				BB7185442C2B0AFC00C1156B /* KMEditPDFColorView.swift */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -12144,6 +12165,8 @@
 		BB6AAF4A2C21721B009C4CB1 /* EditPDF */ = {
 			isa = PBXGroup;
 			children = (
+				BB7185482C2B0DA600C1156B /* Model */,
+				BB71853B2C2B0A6900C1156B /* Toolbar */,
 				BB4D02A72C22D1510001474A /* View */,
 				BB6AAF592C217F94009C4CB1 /* Window */,
 				BB6AAF4B2C21721B009C4CB1 /* Tools */,
@@ -12172,6 +12195,7 @@
 		BB6AAF592C217F94009C4CB1 /* Window */ = {
 			isa = PBXGroup;
 			children = (
+				BB7185372C2B0A1100C1156B /* KMEditPDFPopToolBarWindow.swift */,
 			);
 			path = Window;
 			sourceTree = "<group>";
@@ -12271,6 +12295,23 @@
 			path = Model;
 			sourceTree = "<group>";
 		};
+		BB71853B2C2B0A6900C1156B /* Toolbar */ = {
+			isa = PBXGroup;
+			children = (
+				BB71853C2C2B0A7C00C1156B /* KMEditPDFToolbarView.swift */,
+				BB7185402C2B0AAF00C1156B /* KMEditPDFToolbarItemView.swift */,
+			);
+			path = Toolbar;
+			sourceTree = "<group>";
+		};
+		BB7185482C2B0DA600C1156B /* Model */ = {
+			isa = PBXGroup;
+			children = (
+				BB7185492C2B0DC500C1156B /* KMEditPDFModel.swift */,
+			);
+			path = Model;
+			sourceTree = "<group>";
+		};
 		BB7289DE2B8838BC004B53B5 /* DataManager */ = {
 			isa = PBXGroup;
 			children = (
@@ -15760,6 +15801,7 @@
 				BB146FBD299DC0D100784A6A /* GTMGatherInputStream.m in Sources */,
 				BBB789AE2BE8BF2400F7E09C /* AIChatTranslateResultItem.swift in Sources */,
 				9F78EFC628F7E965001E66F4 /* KMHomeViewController+UI.swift in Sources */,
+				BB7185382C2B0A1100C1156B /* KMEditPDFPopToolBarWindow.swift in Sources */,
 				BB4F7E952B0C857D0077EC8C /* KMNoteTypeCollectionViewItem.swift in Sources */,
 				9F512CC72B4640AB00EC0BC3 /* KMPageDisplayCustomThemesCollectionViewItem.swift in Sources */,
 				BB8F4582295B0F900037EA22 /* KMHeaderFooterMarginInfoView.swift in Sources */,
@@ -16068,6 +16110,7 @@
 				BB93CDE52AE757A000B29C57 /* KMToolbarItemView.swift in Sources */,
 				89E4E6EC2963D1B7002DBA6F /* KMColorPickerViewController.m in Sources */,
 				BB6EA2972B70AF48000D4490 /* KMConvertCompareViewController.m in Sources */,
+				BB71853D2C2B0A7C00C1156B /* KMEditPDFToolbarView.swift in Sources */,
 				ADDEEA862AD7805200EF675D /* KMGeneralButton.swift in Sources */,
 				BB49ED19293F4D4E00C82CA2 /* KMConvertCSVSettingView.swift in Sources */,
 				AD9527BA295291F20039D2BC /* KMPrintPage.swift in Sources */,
@@ -16355,6 +16398,7 @@
 				BBAFFB1B29CDD19C00C56112 /* KMMergeSelect.swift in Sources */,
 				BBE78F1B2B36F69F0071AC1A /* KMLeftSideViewController+Note.swift in Sources */,
 				BB853C7D2AF8B5D6009C20C1 /* KMBatchOperateAddPasswordViewController.swift in Sources */,
+				BB7185452C2B0AFD00C1156B /* KMEditPDFColorView.swift in Sources */,
 				ADD1B6BB29420B4A00C3FFF7 /* KMPrintPreviewView.swift in Sources */,
 				9F1F82B4292DEF370092C4B4 /* KMCloudDocumentsViewController.swift in Sources */,
 				ADE8BC2529F7CCA600570F89 /* KMPageNumberDisplayView.swift in Sources */,
@@ -16576,6 +16620,7 @@
 				ADE86A8A2B02269400414DFA /* KMRemovePasswordWindowController.swift in Sources */,
 				89D2D2C129495D2100BFF5FE /* KMFormModel.swift in Sources */,
 				BBA19F3F29ADE40A001A285A /* KMCellEmptyView.m in Sources */,
+				BB7185412C2B0AAF00C1156B /* KMEditPDFToolbarItemView.swift in Sources */,
 				89316822296D73CC0073EA59 /* KMSignatureAnnotationViewController.m in Sources */,
 				BB89723A294B3C840045787C /* KMWatermarkPropertyController.swift in Sources */,
 				BBB14A6329792D6900936EDB /* KMRedactPageRangeContentView.swift in Sources */,
@@ -16775,6 +16820,7 @@
 				BBBB6CCE2AD13E210035AA66 /* CPDFButtonWidgetAnnotation+PDFListView.swift in Sources */,
 				ADE3C1ED29A5AFB100793B13 /* KMRequestServerManager.swift in Sources */,
 				9F1FE4A229406E4700E952CA /* CTToolbarController.m in Sources */,
+				BB71854A2C2B0DC500C1156B /* KMEditPDFModel.swift in Sources */,
 				BB147041299DC0D200784A6A /* OIDClientMetadataParameters.m in Sources */,
 				ADDEEA6A2AD3CF3A00EF675D /* KMDrawView.swift in Sources */,
 				BBC8A7712B06408600FA9377 /* KMBotaSearchViewController.swift in Sources */,
@@ -17016,6 +17062,7 @@
 				9FB220E02B10850400A5B208 /* KMAnnotationStampViewController.swift in Sources */,
 				BB3A66A42B0783BD00575343 /* KMTocTableCellView.swift in Sources */,
 				BBD426802B4FCF1500AC8660 /* KMTextFieldCell.swift in Sources */,
+				BB7185392C2B0A1100C1156B /* KMEditPDFPopToolBarWindow.swift in Sources */,
 				BBA00AC52B157C880043D903 /* KMToolbarZoomItemView.swift in Sources */,
 				BB1B0AC62B4FC6E900889528 /* KMGuideInfoWindow.swift in Sources */,
 				9F69DBBB2B55014F003D4C45 /* KMAnnotationButtonWidgetAppearanceViewController.swift in Sources */,
@@ -17358,6 +17405,7 @@
 				BB162E93294FFE020088E9D1 /* KMWatermarkModel.swift in Sources */,
 				BB03D6992B0221FF008C9976 /* NSImage+KMExtension.swift in Sources */,
 				ADE86AE72B0AF50B00414DFA /* KMCompareCoveringSettingWindowController.swift in Sources */,
+				BB71853E2C2B0A7C00C1156B /* KMEditPDFToolbarView.swift in Sources */,
 				AD9527CB295297B70039D2BC /* KMPrintModel.swift in Sources */,
 				AD867FA229DEB4B000F00440 /* KMBOTAAnnotationTool.swift in Sources */,
 				9F1FE4B829406E4700E952CA /* CTBrowserFrameView.m in Sources */,
@@ -17396,6 +17444,7 @@
 				ADBC2D29299DCA76006280C8 /* NSTextField+Layer.swift in Sources */,
 				9F0CB4702967E63100007028 /* KMPropertiesPanelNameSubVC.swift in Sources */,
 				9FD0FA3229CD947000F2AB0D /* KMOpacityPanel.swift in Sources */,
+				BB71854B2C2B0DC500C1156B /* KMEditPDFModel.swift in Sources */,
 				BB89722A294B08720045787C /* KMWatermarkAdjectiveTopBarItemModel.swift in Sources */,
 				BB146FCD299DC0D100784A6A /* GTMSessionUploadFetcher.m in Sources */,
 				BB14701E299DC0D100784A6A /* OIDIDToken.m in Sources */,
@@ -17417,6 +17466,7 @@
 				BB897257294C559F0045787C /* KMWatermarkPropertyCreateController.swift in Sources */,
 				9F0CB4CE298654FA00007028 /* KMDesignToken+Height.swift in Sources */,
 				BB4EEF4529764FEF003A3537 /* KMWatermarkAligementView.swift in Sources */,
+				BB7185422C2B0AAF00C1156B /* KMEditPDFToolbarItemView.swift in Sources */,
 				9FD0D2B02AD51BCC00DA3FF8 /* CPDFListEditAnnotationViewController.swift in Sources */,
 				BB853C832AF8BAF0009C20C1 /* KMSetPasswordObject.swift in Sources */,
 				BBB3FF9D2B56852700145C4A /* NSDocument+KMExtensions.swift in Sources */,
@@ -18134,6 +18184,7 @@
 				BBF729A42B19624500576AC5 /* KMAddBackgroundOperationQueue.swift in Sources */,
 				BB2C846A2BAE716600AF6142 /* KMSegmentedControl.swift in Sources */,
 				9F1FE3DF293EE51F00E952CA /* KMMainDocument.swift in Sources */,
+				BB7185462C2B0AFD00C1156B /* KMEditPDFColorView.swift in Sources */,
 				BBB9B320299A5D6D004F3235 /* KMGoogleDriveManager.m in Sources */,
 				AD3AAD7E2B0DFFB100DE5FE7 /* KMAngleIndicateView.swift in Sources */,
 			);
@@ -18178,6 +18229,7 @@
 				BBC8A7732B06408600FA9377 /* KMBotaSearchViewController.swift in Sources */,
 				BBB789B02BE8BF2400F7E09C /* AIChatTranslateResultItem.swift in Sources */,
 				BB8810662B4F74DD00AFA63E /* KMRepeatTrialAlertController.m in Sources */,
+				BB71853A2C2B0A1100C1156B /* KMEditPDFPopToolBarWindow.swift in Sources */,
 				9F1FE51329407B4000E952CA /* KMFileSearchView.swift in Sources */,
 				BBEC00B1295C2AF300A26C98 /* KMBatesPreviewController.swift in Sources */,
 				BBD426812B4FCF1500AC8660 /* KMTextFieldCell.swift in Sources */,
@@ -18486,6 +18538,7 @@
 				AD3AAD3A2B0B7B1900DE5FE7 /* KMCompareToolbar.swift in Sources */,
 				AD8DD2A52A9C35B2007CC9D0 /* KMThumbnailManager.swift in Sources */,
 				BB6719FF2AD2CE1B003D44D5 /* CPDFSquareAnnotation+PDFListView.swift in Sources */,
+				BB71853F2C2B0A7C00C1156B /* KMEditPDFToolbarView.swift in Sources */,
 				BBEDC22D2B98407000970C54 /* CPDFAction+KMExtension.swift in Sources */,
 				BBEF0F9C2B84A4C200A3E102 /* KMBrowserWindowController+Actions.swift in Sources */,
 				BB8B99FF2B355E7600A066EC /* KMLeftSideViewController+Action.swift in Sources */,
@@ -18773,6 +18826,7 @@
 				F35B484D29A4903300756255 /* NSPointerArray+PDFListView.m in Sources */,
 				BBC70EB62AEA847500AC1585 /* KMToolbarCustomViewController.swift in Sources */,
 				89752E062939DB42003FF08E /* KMToolbarViewController.swift in Sources */,
+				BB7185472C2B0AFD00C1156B /* KMEditPDFColorView.swift in Sources */,
 				89D2D2FD294C806000BFF5FE /* KMPDFThumbnailItem.swift in Sources */,
 				BBFBE74928DD7DB8008B2335 /* ViewController.swift in Sources */,
 				BB6719F72AD2C949003D44D5 /* CPDFRedactAnnotation+PDFListView.swift in Sources */,
@@ -18994,6 +19048,7 @@
 				ADDF83A32B391A5D00A81A4E /* DSignatureFileListViewController.swift in Sources */,
 				AD68782329A5FADC005B5210 /* KMLightMemberCache.swift in Sources */,
 				AD7D5C832B8ECD09006562CD /* KMPDFSynchronizer.swift in Sources */,
+				BB7185432C2B0AAF00C1156B /* KMEditPDFToolbarItemView.swift in Sources */,
 				BB8F4584295B0F900037EA22 /* KMHeaderFooterMarginInfoView.swift in Sources */,
 				AD4C71732B9ADFE0003A6286 /* NSError_Extensions.swift in Sources */,
 				BB49ED17293F489500C82CA2 /* KMConvertImageSettingView.swift in Sources */,
@@ -19193,6 +19248,7 @@
 				9FA693AA2987C0590055488A /* KMStepperView.swift in Sources */,
 				9F1FE4F829406E4700E952CA /* CTFloatingBarBackingView.m in Sources */,
 				BBAFDA7B2B4CDE0000278BC3 /* KMPDFCropWindowController.swift in Sources */,
+				BB71854C2C2B0DC500C1156B /* KMEditPDFModel.swift in Sources */,
 				BBB612AB2AF48952000F3724 /* KMBackgroundObject.swift in Sources */,
 				9F1FE49E29406E4700E952CA /* HoverCloseButton.m in Sources */,
 				BB3A81B22AC2B82A006FC66C /* KMPageSizeTool.swift in Sources */,