|
@@ -70,10 +70,14 @@ class KMPageEditThumbnailItem: NSCollectionViewItem {
|
|
|
self.textBox.addSubview(self.pageTextLabel)
|
|
|
self.textBox.addSubview(self.pageSizeTextLabel)
|
|
|
|
|
|
- self.backgroundView.wantsLayer = true
|
|
|
- self.backgroundView.layer?.cornerRadius = 8.0
|
|
|
- self.backgroundView.layer?.masksToBounds = true
|
|
|
- self.backgroundView.layer?.borderWidth = 1.0
|
|
|
+ self.pageBox.wantsLayer = true
|
|
|
+ self.pageBox.layer?.backgroundColor = NSColor(white: 192.0/255.0, alpha: 1.0).cgColor
|
|
|
+ self.pageBox.layer?.cornerRadius = 6
|
|
|
+ self.pageBox.layer?.masksToBounds = true
|
|
|
+// self.backgroundView.wantsLayer = true
|
|
|
+// self.backgroundView.layer?.cornerRadius = 8.0
|
|
|
+// self.backgroundView.layer?.masksToBounds = true
|
|
|
+// self.backgroundView.layer?.borderWidth = 1.0
|
|
|
self.isSelected = false
|
|
|
|
|
|
self.pageView.wantsLayer = true
|
|
@@ -134,11 +138,13 @@ class KMPageEditThumbnailItem: NSCollectionViewItem {
|
|
|
super.isSelected = newValue
|
|
|
|
|
|
if (newValue) {
|
|
|
- self.backgroundView.layer?.backgroundColor = NSColor.km_init(hex: "#1770F41A").cgColor
|
|
|
- self.backgroundView.layer?.borderColor = NSColor.km_init(hex: "#1770F4").cgColor
|
|
|
+// self.backgroundView.layer?.backgroundColor = NSColor.km_init(hex: "#1770F41A").cgColor
|
|
|
+// self.backgroundView.layer?.borderColor = NSColor.km_init(hex: "#1770F4").cgColor
|
|
|
+ self.pageBox.layer?.backgroundColor = NSColor(white: 192.0/255.0, alpha: 1.0).cgColor
|
|
|
} else {
|
|
|
- self.backgroundView.layer?.backgroundColor = NSColor.clear.cgColor
|
|
|
- self.backgroundView.layer?.borderColor = NSColor.clear.cgColor
|
|
|
+// self.backgroundView.layer?.backgroundColor = NSColor.clear.cgColor
|
|
|
+// self.backgroundView.layer?.borderColor = NSColor.clear.cgColor
|
|
|
+ self.pageBox.layer?.backgroundColor = .clear
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -166,19 +172,19 @@ class KMPageEditThumbnailItem: NSCollectionViewItem {
|
|
|
let viewWidth: CGFloat = NSWidth(self.view.bounds)
|
|
|
let viewHeight: CGFloat = NSHeight(self.view.bounds)
|
|
|
|
|
|
- let backgroundViewX: CGFloat = 12;
|
|
|
+ let backgroundViewX: CGFloat = 0;
|
|
|
let backgroundViewY: CGFloat = 24;
|
|
|
let backgroundViewW: CGFloat = viewWidth - backgroundViewX * 2;
|
|
|
let backgroundViewH: CGFloat = viewHeight - 24;
|
|
|
- self.backgroundView.frame = NSMakeRect(backgroundViewX, backgroundViewY, backgroundViewW, backgroundViewH)
|
|
|
+// self.backgroundView.frame = NSMakeRect(backgroundViewX, backgroundViewY, backgroundViewW, backgroundViewH)
|
|
|
|
|
|
var bounds = page.bounds
|
|
|
let transform = page.transform()
|
|
|
bounds = bounds.applying(transform)
|
|
|
|
|
|
- var size = NSMakeSize(backgroundViewW-32, backgroundViewH-46)
|
|
|
+ var size = NSMakeSize(backgroundViewW, backgroundViewH-26)
|
|
|
if (self.isShowPageSize == false) {
|
|
|
- size = NSMakeSize(backgroundViewW-32, backgroundViewH-72)
|
|
|
+ size = NSMakeSize(backgroundViewW, backgroundViewH-52)
|
|
|
}
|
|
|
|
|
|
if (page.rotation == -90 || page.rotation == -270) {
|
|
@@ -228,7 +234,7 @@ class KMPageEditThumbnailItem: NSCollectionViewItem {
|
|
|
self.pageTextLabel.frame = NSMakeRect((textWidth-textSize.width)*0.5, 4, textSize.width, height);
|
|
|
}
|
|
|
|
|
|
- let margin: CGFloat = 16 + NSMinX(self.backgroundView.frame)
|
|
|
+ let margin: CGFloat = NSMinX(self.backgroundView.frame)
|
|
|
let pageBoxY: CGFloat = self.textBox.frame.maxY+8
|
|
|
let pageBoxW: CGFloat = viewWidth-margin*2
|
|
|
let pageBoxH: CGFloat = viewHeight-pageBoxY-8
|