|
@@ -318,6 +318,14 @@ class KMToolbarViewController: NSViewController, NSTextFieldDelegate {
|
|
|
self.delegate?.toolbarViewController?(self, clickChaildToolType: type, toolbar: item)
|
|
|
}
|
|
|
|
|
|
+ @objc private func _pdfToImageAction(sender: NSMenuItem) {
|
|
|
+ if let data = self._currentItemView {
|
|
|
+ self.delegate?.toolbarViewController?(self, menuItemDidClick: data, index: sender.tag, info: nil)
|
|
|
+ } else {
|
|
|
+ self.delegate?.toolbarViewController?(self, menuItemDidClick: self.toolbarItemFindItemIdentifiers(value: KMToolbarConversionImageItemIdentifier), index: sender.tag, info: nil)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@IBAction func zoomModelSelectButtonAction(_ sender: NSPopUpButton) {
|
|
|
self.delegate?.toolbarViewController?(self, zoomModel: sender.selectedTag())
|
|
@@ -1234,8 +1242,22 @@ extension KMToolbarViewController {
|
|
|
item?.btnTag = KMToolbarType.conversion_image.rawValue
|
|
|
item?.toolTip = NSLocalizedString("Convert PDF to JPEG, PNG, TIFF, BMP, GIF or TGA files", comment: "")
|
|
|
item?.titleName = NSLocalizedString("To Image", comment: "")
|
|
|
- item?.boxImagePosition = .imageLeft
|
|
|
+ item?.boxImagePosition = .imageExpandLeft
|
|
|
+ item?.needExpandAction = true
|
|
|
item?.btnAction = #selector(conversionMenuItemAction)
|
|
|
+
|
|
|
+ let menuItem = NSMenuItem.init(title: "To Image", action: #selector(conversionMenuItemAction), target: self)
|
|
|
+ let subMenu = NSMenu()
|
|
|
+ subMenu.addItem(title: NSLocalizedString("PDF To JPEG", comment: ""), action: #selector(_pdfToImageAction), target: self, tag: KMPDFConvertType.jpeg.rawValue)
|
|
|
+ subMenu.addItem(title: NSLocalizedString("PDF To JPG", comment: ""), action: #selector(_pdfToImageAction), target: self, tag: KMPDFConvertType.jpg.rawValue)
|
|
|
+ subMenu.addItem(title: NSLocalizedString("PDF To PNG", comment: ""), action: #selector(_pdfToImageAction), target: self, tag: KMPDFConvertType.png.rawValue)
|
|
|
+ subMenu.addItem(title: NSLocalizedString("PDF To GIF", comment: ""), action: #selector(_pdfToImageAction), target: self, tag: KMPDFConvertType.gif.rawValue)
|
|
|
+ subMenu.addItem(title: NSLocalizedString("PDF To TIFF", comment: ""), action: #selector(_pdfToImageAction), target: self, tag: KMPDFConvertType.tiff.rawValue)
|
|
|
+ subMenu.addItem(title: NSLocalizedString("PDF To TGA", comment: ""), action: #selector(_pdfToImageAction), target: self, tag: KMPDFConvertType.tga.rawValue)
|
|
|
+ subMenu.addItem(title: NSLocalizedString("PDF To BMP", comment: ""), action: #selector(_pdfToImageAction), target: self, tag: KMPDFConvertType.bmp.rawValue)
|
|
|
+
|
|
|
+ menuItem.submenu = subMenu
|
|
|
+ item?.menuFormRepresentation = menuItem
|
|
|
}
|
|
|
}
|
|
|
|