|
@@ -89,53 +89,53 @@ extension KMMainViewController {
|
|
// scale
|
|
// scale
|
|
|
|
|
|
@IBAction func menuItemAction_adjustWidth(_ sender: Any) {
|
|
@IBAction func menuItemAction_adjustWidth(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ KMPreferenceManager.shared.viewZoomScaleType = 0
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_adjustPage(_ sender: Any) {
|
|
@IBAction func menuItemAction_adjustPage(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ KMPreferenceManager.shared.viewZoomScaleType = 1
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_size(_ sender: Any) {
|
|
@IBAction func menuItemAction_size(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ KMPreferenceManager.shared.viewZoomScaleType = 2
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_zoomOut(_ sender: Any) {
|
|
@IBAction func menuItemAction_zoomOut(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ self.listView.zoomOut(nil)
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_zoomIn(_ sender: Any) {
|
|
@IBAction func menuItemAction_zoomIn(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ self.listView.zoomIn(nil)
|
|
}
|
|
}
|
|
|
|
|
|
// page show
|
|
// page show
|
|
|
|
|
|
@IBAction func menuItemAction_singlePage(_ sender: Any) {
|
|
@IBAction func menuItemAction_singlePage(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ KMPreferenceManager.shared.viewPageDisplayType = 0
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_singlePageContinue(_ sender: Any) {
|
|
@IBAction func menuItemAction_singlePageContinue(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ KMPreferenceManager.shared.viewPageDisplayType = 1
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_doublePage(_ sender: Any) {
|
|
@IBAction func menuItemAction_doublePage(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ KMPreferenceManager.shared.viewPageDisplayType = 2
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_doublePageContinue(_ sender: Any) {
|
|
@IBAction func menuItemAction_doublePageContinue(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ KMPreferenceManager.shared.viewPageDisplayType = 3
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_bookMode(_ sender: Any) {
|
|
@IBAction func menuItemAction_bookMode(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ KMPreferenceManager.shared.viewPageDisplayType = 4
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_readMode(_ sender: Any) {
|
|
@IBAction func menuItemAction_readMode(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_showSplitPage(_ sender: Any) {
|
|
@IBAction func menuItemAction_showSplitPage(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ self.listView?.displaysPageBreaks = !(self.listView?.displaysPageBreaks ?? false)
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_autoScrol(_ sender: Any) {
|
|
@IBAction func menuItemAction_autoScrol(_ sender: Any) {
|
|
@@ -149,19 +149,63 @@ extension KMMainViewController {
|
|
// rotate
|
|
// rotate
|
|
|
|
|
|
@IBAction func menuItemAction_rotateLeft(_ sender: Any) {
|
|
@IBAction func menuItemAction_rotateLeft(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ let page : CPDFPage = self.listView?.currentPage() ?? CPDFPage()
|
|
|
|
+ if page.rotation == 0 {
|
|
|
|
+ page.rotation = 90
|
|
|
|
+ } else if page.rotation == 90 {
|
|
|
|
+ page.rotation = 180
|
|
|
|
+ } else if page.rotation == 180 {
|
|
|
|
+ page.rotation = 270
|
|
|
|
+ } else if page.rotation == 270 {
|
|
|
|
+ page.rotation = 0
|
|
|
|
+ }
|
|
|
|
+ self.listView?.layoutDocumentView()
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_rotateRight(_ sender: Any) {
|
|
@IBAction func menuItemAction_rotateRight(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ let page : CPDFPage = self.listView?.currentPage() ?? CPDFPage()
|
|
|
|
+ if page.rotation == 0 {
|
|
|
|
+ page.rotation = 270
|
|
|
|
+ } else if page.rotation == 90 {
|
|
|
|
+ page.rotation = 0
|
|
|
|
+ } else if page.rotation == 180 {
|
|
|
|
+ page.rotation = 90
|
|
|
|
+ } else if page.rotation == 270 {
|
|
|
|
+ page.rotation = 180
|
|
|
|
+ }
|
|
|
|
+ self.listView?.layoutDocumentView()
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_rotateAllPageLeft(_ sender: Any) {
|
|
@IBAction func menuItemAction_rotateAllPageLeft(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ for index in 0 ... self.listView.document.pageCount - 1 {
|
|
|
|
+ let page : CPDFPage = self.listView.document.page(at: index)
|
|
|
|
+ if page.rotation == 0 {
|
|
|
|
+ page.rotation = 90
|
|
|
|
+ } else if page.rotation == 90 {
|
|
|
|
+ page.rotation = 180
|
|
|
|
+ } else if page.rotation == 180 {
|
|
|
|
+ page.rotation = 270
|
|
|
|
+ } else if page.rotation == 270 {
|
|
|
|
+ page.rotation = 0
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ self.listView?.layoutDocumentView()
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_rotateAllPageRight(_ sender: Any) {
|
|
@IBAction func menuItemAction_rotateAllPageRight(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ for index in 0 ... self.listView.document.pageCount - 1 {
|
|
|
|
+ let page : CPDFPage = self.listView.document.page(at: index)
|
|
|
|
+ if page.rotation == 0 {
|
|
|
|
+ page.rotation = 270
|
|
|
|
+ } else if page.rotation == 90 {
|
|
|
|
+ page.rotation = 0
|
|
|
|
+ } else if page.rotation == 180 {
|
|
|
|
+ page.rotation = 90
|
|
|
|
+ } else if page.rotation == 270 {
|
|
|
|
+ page.rotation = 180
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ self.listView?.layoutDocumentView()
|
|
}
|
|
}
|
|
|
|
|
|
// split screen
|
|
// split screen
|
|
@@ -187,27 +231,67 @@ extension KMMainViewController {
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_hiddenLeftSide(_ sender: Any) {
|
|
@IBAction func menuItemAction_hiddenLeftSide(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ self.closeLeftPane()
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_thumai(_ sender: Any) {
|
|
@IBAction func menuItemAction_thumai(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ let thumai = KMLeftMethodMode()
|
|
|
|
+ var show = true
|
|
|
|
+ if self.leftSideViewController.type.methodType != .Thumbnail {
|
|
|
|
+ thumai.methodType = .Thumbnail
|
|
|
|
+ }
|
|
|
|
+ if self.leftSideViewController.type.methodType == .Thumbnail {
|
|
|
|
+ show = false
|
|
|
|
+ }
|
|
|
|
+ self.leftSideViewController.refreshMethodType(newType: thumai, show:show)
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_outline(_ sender: Any) {
|
|
@IBAction func menuItemAction_outline(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ let thumai = KMLeftMethodMode()
|
|
|
|
+ var show = true
|
|
|
|
+ if self.leftSideViewController.type.methodType != .Outline {
|
|
|
|
+ thumai.methodType = .Outline
|
|
|
|
+ }
|
|
|
|
+ if self.leftSideViewController.type.methodType == .Outline {
|
|
|
|
+ show = false
|
|
|
|
+ }
|
|
|
|
+ self.leftSideViewController.refreshMethodType(newType: thumai, show:show)
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_bookmark(_ sender: Any) {
|
|
@IBAction func menuItemAction_bookmark(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ let thumai = KMLeftMethodMode()
|
|
|
|
+ var show = true
|
|
|
|
+ if self.leftSideViewController.type.methodType != .BookMark {
|
|
|
|
+ thumai.methodType = .BookMark
|
|
|
|
+ }
|
|
|
|
+ if self.leftSideViewController.type.methodType == .BookMark {
|
|
|
|
+ show = false
|
|
|
|
+ }
|
|
|
|
+ self.leftSideViewController.refreshMethodType(newType: thumai, show:show)
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_annotation(_ sender: Any) {
|
|
@IBAction func menuItemAction_annotation(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ let thumai = KMLeftMethodMode()
|
|
|
|
+ var show = true
|
|
|
|
+ if self.leftSideViewController.type.methodType != .Annotation {
|
|
|
|
+ thumai.methodType = .Annotation
|
|
|
|
+ }
|
|
|
|
+ if self.leftSideViewController.type.methodType == .Annotation {
|
|
|
|
+ show = false
|
|
|
|
+ }
|
|
|
|
+ self.leftSideViewController.refreshMethodType(newType: thumai, show:show)
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_search(_ sender: Any) {
|
|
@IBAction func menuItemAction_search(_ sender: Any) {
|
|
-
|
|
|
|
|
|
+ let thumai = KMLeftMethodMode()
|
|
|
|
+ var show = true
|
|
|
|
+ if self.leftSideViewController.type.methodType != .Search {
|
|
|
|
+ thumai.methodType = .Search
|
|
|
|
+ }
|
|
|
|
+ if self.leftSideViewController.type.methodType == .Search {
|
|
|
|
+ show = false
|
|
|
|
+ }
|
|
|
|
+ self.leftSideViewController.refreshMethodType(newType: thumai, show:show)
|
|
}
|
|
}
|
|
|
|
|
|
@IBAction func menuItemAction_topic(_ sender: Any) {
|
|
@IBAction func menuItemAction_topic(_ sender: Any) {
|