|
@@ -37,13 +37,25 @@ class KMPageEditInsertPageSizeItemView: KMPageEditBaseItemView {
|
|
|
self.currentPageVC?.enabled = false
|
|
|
self.currentPageVC?.state = .Disabled
|
|
|
self.currentPageVC?.stringValue = "\(NSLocalizedString("Current page", comment: ""))(0 x 0mm)"
|
|
|
+ self.currentPageVC?.checkbox_radio()
|
|
|
|
|
|
if let radio = self.standardVC {
|
|
|
self.selectRadio(radio)
|
|
|
}
|
|
|
} else {
|
|
|
self.currentPageVC?.enabled = true
|
|
|
- self.currentPageVC?.stringValue = "\(NSLocalizedString("Current page", comment: ""))(\(Int(newValue.width)) x \(Int(newValue.height))mm)"
|
|
|
+ let width = KMPageSizeTool.conversion(withUnit: "mm", value: newValue.width/595*210)
|
|
|
+ let height = KMPageSizeTool.conversion(withUnit: "mm", value: newValue.height/842*297)
|
|
|
+ var widthValue: String = "0"
|
|
|
+ var heightValue: String = "0"
|
|
|
+ if let _value = Float(width) {
|
|
|
+ widthValue = String(format: "%.1f", _value)
|
|
|
+ }
|
|
|
+ if let _value = Float(height) {
|
|
|
+ heightValue = String(format: "%.1f", _value)
|
|
|
+ }
|
|
|
+
|
|
|
+ self.currentPageVC?.stringValue = "\(NSLocalizedString("Current page", comment: ""))(\(widthValue) x \(heightValue)mm)"
|
|
|
self.currentPageVC?.checkbox_radio()
|
|
|
|
|
|
if let radio = self.currentPageVC {
|
|
@@ -134,7 +146,7 @@ class KMPageEditInsertPageSizeItemView: KMPageEditBaseItemView {
|
|
|
let contentY = NSMaxY(self.titleLabel.frame)
|
|
|
let radioH: CGFloat = 32
|
|
|
let vSpace: CGFloat = 12
|
|
|
- self.currentPageVC?.view.frame = NSMakeRect(leftMargin, contentY, 250, radioH)
|
|
|
+ self.currentPageVC?.view.frame = NSMakeRect(leftMargin, contentY, 280, radioH)
|
|
|
|
|
|
let standardY: CGFloat = contentY+radioH+vSpace
|
|
|
let standardW: CGFloat = 90
|
|
@@ -147,7 +159,7 @@ class KMPageEditInsertPageSizeItemView: KMPageEditBaseItemView {
|
|
|
self.customVC?.view.frame = NSMakeRect(leftMargin, standardY+radioH+vSpace, customW + 10, radioH)
|
|
|
|
|
|
let customY: CGFloat = standardY+radioH+vSpace
|
|
|
- let customViewW: CGFloat = 80
|
|
|
+ let customViewW: CGFloat = 94
|
|
|
let customH: CGFloat = 32
|
|
|
self.cwTextField?.frame = NSMakeRect(leftMargin+customW+10, customY, customViewW, customH)
|
|
|
|
|
@@ -238,9 +250,11 @@ class KMPageEditInsertPageSizeItemView: KMPageEditBaseItemView {
|
|
|
if let state = self.customVC?.state, state == .Checked {
|
|
|
self.cwTextField?.kmEnabled = true
|
|
|
self.chTextField?.kmEnabled = true
|
|
|
+ self.customComboVC?.enabled = true
|
|
|
} else {
|
|
|
self.cwTextField?.kmEnabled = false
|
|
|
self.chTextField?.kmEnabled = false
|
|
|
+ self.customComboVC?.enabled = false
|
|
|
self.window?.makeFirstResponder(nil)
|
|
|
}
|
|
|
}
|