mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-22 06:15:59 +00:00
Add device name lookup for unnamed devices
This commit is contained in:
1 parent
84d2150893
commit
e6d1c7b1a3
9 files changed
+397
-24
No files matched your search
@@ -9,6 +9,7 @@ import Cocoa
|
||||
|
||||
class DeviceListCell: NSCollectionViewItem {
|
||||
public var clickHandler: (() -> Void)?
|
||||
@IBOutlet private var peerMarkerView: NSImageView?
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
@@ -17,10 +18,20 @@ class DeviceListCell: NSCollectionViewItem {
|
||||
btn.setButtonType(.momentaryPushIn)
|
||||
btn.action = #selector(onClick)
|
||||
btn.target = self
|
||||
|
||||
peerMarkerView?.image = NSImage(named: "MenuBarIcon")
|
||||
peerMarkerView?.image?.isTemplate = true
|
||||
peerMarkerView?.contentTintColor = .white
|
||||
}
|
||||
|
||||
@IBAction func onClick(_: Any?) {
|
||||
guard let handler = clickHandler else { return }
|
||||
handler()
|
||||
}
|
||||
|
||||
func configure(deviceName: String, deviceImage: NSImage, showsQuickDropPeerMarker: Bool) {
|
||||
textField?.stringValue = deviceName
|
||||
imageView?.image = deviceImage
|
||||
peerMarkerView?.isHidden = !showsQuickDropPeerMarker
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user