fix: keyboard selection now works with dragging + mouse hover
(closes #4711)
This commit is contained in:
1 parent
1a4b53917d
commit
be077f1a67
1 file changed
+13
-2
@@ -45,17 +45,28 @@ class ThumbnailView: FlippedView {
|
||||
|
||||
override func isAccessibilityElement() -> Bool { true }
|
||||
|
||||
override func wantsPeriodicDraggingUpdates() -> Bool { false }
|
||||
|
||||
override func draggingUpdated(_ sender: NSDraggingInfo) -> NSDragOperation {
|
||||
mouseMovedCallback()
|
||||
setDraggingTimer()
|
||||
return .link
|
||||
}
|
||||
|
||||
override func draggingEntered(_ sender: NSDraggingInfo) -> NSDragOperation {
|
||||
setDraggingTimer()
|
||||
return .link
|
||||
}
|
||||
|
||||
private func setDraggingTimer() {
|
||||
dragAndDropTimer?.invalidate()
|
||||
dragAndDropTimer = Timer.scheduledTimer(withTimeInterval: 2, repeats: false, block: { _ in
|
||||
self.mouseUpCallback()
|
||||
// the user can tab to focus the next thumbnail, while still dragging. We don't want to perform drag then
|
||||
if Windows.focusedWindowIndex == Windows.hoveredWindowIndex {
|
||||
self.mouseUpCallback()
|
||||
}
|
||||
})
|
||||
dragAndDropTimer?.tolerance = 0.2
|
||||
return .link
|
||||
}
|
||||
|
||||
override func draggingExited(_ sender: NSDraggingInfo?) {
|
||||
|
||||
Reference in new issue
Block a user