mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
33 lines
665 B
Swift
33 lines
665 B
Swift
//
|
|
// AlbumCoverButton.swift
|
|
// Persephone
|
|
//
|
|
// Created by Daniel Barber on 2019/6/28.
|
|
// Copyright © 2019 Dan Barber. All rights reserved.
|
|
//
|
|
|
|
import AppKit
|
|
|
|
class AlbumCoverButton: NSButton {
|
|
var dragging = false
|
|
|
|
override func mouseDown(with event: NSEvent) {
|
|
nextResponder?.mouseDown(with: event)
|
|
}
|
|
|
|
override func mouseDragged(with event: NSEvent) {
|
|
dragging = true
|
|
nextResponder?.mouseDragged(with: event)
|
|
}
|
|
|
|
override func mouseUp(with event: NSEvent) {
|
|
if dragging {
|
|
dragging = false
|
|
nextResponder?.mouseUp(with: event)
|
|
} else {
|
|
super.mouseDown(with: event)
|
|
super.mouseUp(with: event)
|
|
}
|
|
}
|
|
}
|