Merge branch 'master' into save-button
This commit is contained in:
@@ -20,6 +20,11 @@ class CustomVisualEffect: NSVisualEffectView {
|
||||
trackingArea = NSTrackingArea(rect: bounds, options: opts, owner: self, userInfo: nil)
|
||||
self.addTrackingArea(trackingArea)
|
||||
|
||||
var fadeAnim = CABasicAnimation(keyPath: "opacity")
|
||||
fadeAnim.fromValue = 1.0
|
||||
fadeAnim.toValue = 0
|
||||
fadeAnim.duration = 0.1
|
||||
self.layer?.add(fadeAnim, forKey: "opacity")
|
||||
self.alphaValue = 0
|
||||
}
|
||||
|
||||
@@ -31,6 +36,11 @@ class CustomVisualEffect: NSVisualEffectView {
|
||||
trackingArea = NSTrackingArea(rect: bounds, options: opts, owner: self, userInfo: nil)
|
||||
self.addTrackingArea(trackingArea)
|
||||
|
||||
var fadeAnim = CABasicAnimation(keyPath: "opacity")
|
||||
fadeAnim.fromValue = 1.0
|
||||
fadeAnim.toValue = 0
|
||||
fadeAnim.duration = 0.1
|
||||
self.layer?.add(fadeAnim, forKey: "opacity")
|
||||
self.alphaValue = 0
|
||||
}
|
||||
|
||||
@@ -40,10 +50,21 @@ class CustomVisualEffect: NSVisualEffectView {
|
||||
|
||||
// MARK: mouse events
|
||||
override func mouseEntered(with theEvent: NSEvent) {
|
||||
var fadeAnim = CABasicAnimation(keyPath: "opacity")
|
||||
fadeAnim.fromValue = 0.0
|
||||
fadeAnim.toValue = 1
|
||||
fadeAnim.duration = 0.1
|
||||
self.layer?.add(fadeAnim, forKey: "opacity")
|
||||
//self.alphaValue = 0
|
||||
self.alphaValue = 1
|
||||
}
|
||||
|
||||
override func mouseExited(with theEvent: NSEvent) {
|
||||
var fadeAnim = CABasicAnimation(keyPath: "opacity")
|
||||
fadeAnim.fromValue = 1.0
|
||||
fadeAnim.toValue = 0
|
||||
fadeAnim.duration = 0.1
|
||||
self.layer?.add(fadeAnim, forKey: "opacity")
|
||||
self.alphaValue = 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user