|
@@ -12,6 +12,10 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
|
|
|
@IBOutlet weak var topBarBox: NSBox!
|
|
|
@IBOutlet weak var contentBox: NSBox!
|
|
|
|
|
|
+ @IBOutlet weak var thumbnailSizeView: NSView!
|
|
|
+ @IBOutlet weak var lineBoxView: NSView!
|
|
|
+
|
|
|
+
|
|
|
var toolBar = KMPDFEditToolbar(frame: NSZeroRect)
|
|
|
override var thumbnailView: KMPDFThumbnailView {
|
|
|
get {
|
|
@@ -46,8 +50,8 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
|
|
|
var pageIsUpdate: Bool = true
|
|
|
var selectedPages: [Int] = []
|
|
|
|
|
|
- private let defaultItemSize = NSMakeSize(200, 200)
|
|
|
- var itemSize: NSSize = NSMakeSize(200, 200)
|
|
|
+ private let defaultItemSize = NSMakeSize(215, 250)
|
|
|
+ var itemSize: NSSize = NSMakeSize(215, 250)
|
|
|
|
|
|
// index=1 双击退出;index=2 打印
|
|
|
var itemClick: KMCommonClickBlock?
|
|
@@ -125,6 +129,12 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
|
|
|
self.thumbnailView.collectionView.wantsLayer = true
|
|
|
self.thumbnailView.collectionView.layer?.backgroundColor = KMAppearance.PDFViewBackgroundColor().cgColor
|
|
|
|
|
|
+ self.thumbnailSizeView.wantsLayer = true
|
|
|
+ self.thumbnailSizeView.layer?.backgroundColor = KMAppearance.Layout.b80Color().cgColor
|
|
|
+ self.lineBoxView.wantsLayer = true
|
|
|
+ self.lineBoxView.layer?.backgroundColor = KMAppearance.Layout.h2Color().cgColor
|
|
|
+
|
|
|
+
|
|
|
var allowedFileTypes: [String] = []
|
|
|
// if let _types = KMConvertPDFManager.supportFileType() {
|
|
|
allowedFileTypes = KMTools.pdfExtensions + KMConvertPDFManager.supportFileType()
|
|
@@ -677,13 +687,13 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
|
|
|
if (self.itemSize.width < self.defaultItemSize.width) {
|
|
|
self.itemSize = self.defaultItemSize
|
|
|
} else if (self.itemSize.width == self.defaultItemSize.width) {
|
|
|
- self.itemSize = NSSize(width: self.defaultItemSize.width*1.5, height: self.defaultItemSize.height*1.5)
|
|
|
+ self.itemSize = NSSize(width: self.defaultItemSize.width*2, height: self.defaultItemSize.height*2)
|
|
|
}
|
|
|
|
|
|
- self.toolBar.zoomInButton?.isEnabled = true
|
|
|
- if (self.itemSize.width > self.defaultItemSize.width) {
|
|
|
- sender?.isEnabled = false
|
|
|
- }
|
|
|
+// self.toolBar.zoomInButton?.isEnabled = true
|
|
|
+// if (self.itemSize.width > self.defaultItemSize.width) {
|
|
|
+// sender?.isEnabled = false
|
|
|
+// }
|
|
|
self.pageEditThumbnailView.zoomOut()
|
|
|
}
|
|
|
|
|
@@ -705,10 +715,10 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
|
|
|
self.itemSize = NSSize(width: self.defaultItemSize.width*0.5, height: self.defaultItemSize.height*0.5)
|
|
|
}
|
|
|
|
|
|
- self.toolBar.zoomOutButton?.isEnabled = true
|
|
|
- if (self.itemSize.width < self.defaultItemSize.width) {
|
|
|
- sender?.isEnabled = false
|
|
|
- }
|
|
|
+// self.toolBar.zoomOutButton?.isEnabled = true
|
|
|
+// if (self.itemSize.width < self.defaultItemSize.width) {
|
|
|
+// sender?.isEnabled = false
|
|
|
+// }
|
|
|
self.pageEditThumbnailView.zoomIn()
|
|
|
}
|
|
|
|
|
@@ -835,6 +845,26 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
|
|
|
}
|
|
|
return item_
|
|
|
}
|
|
|
+
|
|
|
+ // MARK: - Zoom Methods
|
|
|
+
|
|
|
+ @IBAction func buttonClicked_Bigger(_ sender: AnyObject?) {
|
|
|
+// if (self.thumbnailView.thumbnailSize.width == 100.) {
|
|
|
+// self.thumbnailView.thumbnailSize = CGSizeMake(200, 200);
|
|
|
+// } else if (self.thumbnailView.thumbnailSize.width == 200.) {
|
|
|
+// self.thumbnailView.thumbnailSize = CGSizeMake(400, 400);
|
|
|
+// }
|
|
|
+ self.zoomOutButtonAction(sender: sender as? NSButton)
|
|
|
+ }
|
|
|
+
|
|
|
+ @IBAction func buttonClicked_Smaller(_ sender: AnyObject?) {
|
|
|
+// if (self.thumbnailView.thumbnailSize.width == 400.) {
|
|
|
+// self.thumbnailView.thumbnailSize = CGSizeMake(200, 200);
|
|
|
+// } else if (self.thumbnailView.thumbnailSize.width == 200.) {
|
|
|
+// self.thumbnailView.thumbnailSize = CGSizeMake(100, 100);
|
|
|
+// }
|
|
|
+ self.zoomInButtonAction(sender: sender as? NSButton)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
extension KMPDFEditViewController {
|