Browse Source

Cleanup unused mouse tracking code.

pull/113/head
Abhishek Banthia 3 years ago
parent
commit
81796464ef
  1. 32
      Clocker/Panel/Rate Controller/UpcomingEventView.swift

32
Clocker/Panel/Rate Controller/UpcomingEventView.swift

@ -2,38 +2,6 @@
import Cocoa import Cocoa
class UpcomingEventView: NSView {
private var trackingArea: NSTrackingArea?
override func mouseEntered(with event: NSEvent) {
super.mouseEntered(with: event)
let dismissalButton = subviews.filter { $0.tag == 55 }.first
if let firstMatch = dismissalButton, firstMatch.isHidden {
firstMatch.isHidden = false
}
}
override func mouseExited(with event: NSEvent) {
super.mouseExited(with: event)
let dismissalButton = subviews.filter { $0.tag == 55 }.first
if let firstMatch = dismissalButton, !firstMatch.isHidden {
firstMatch.isHidden = true
}
}
override func updateTrackingAreas() {
super.updateTrackingAreas()
if let trackingArea = self.trackingArea {
removeTrackingArea(trackingArea)
}
let options: NSTrackingArea.Options = [.mouseEnteredAndExited, .activeAlways]
let trackingArea = NSTrackingArea(rect: bounds, options: options, owner: self, userInfo: nil)
addTrackingArea(trackingArea)
}
}
class ModernSliderContainerView: NSView { class ModernSliderContainerView: NSView {
private var trackingArea: NSTrackingArea? private var trackingArea: NSTrackingArea?
public var currentlyInFocus = false public var currentlyInFocus = false

Loading…
Cancel
Save