fix: better mouse hover behavior (#1557)
This commit is contained in:
1 parent
634cf79916
commit
d3cabc1c05
2 files changed
+1
-7
No files matched your search
@@ -23,7 +23,6 @@ class ThumbnailView: NSStackView {
|
|||||||
var shouldShowWindowControls = false
|
var shouldShowWindowControls = false
|
||||||
var isShowingWindowControls = false
|
var isShowingWindowControls = false
|
||||||
var windowlessIcon = FontIcon(.newWindow)
|
var windowlessIcon = FontIcon(.newWindow)
|
||||||
var mouseIsHovering = false
|
|
||||||
|
|
||||||
// for VoiceOver cursor
|
// for VoiceOver cursor
|
||||||
override var canBecomeKeyView: Bool { true }
|
override var canBecomeKeyView: Bool { true }
|
||||||
@@ -90,7 +89,7 @@ class ThumbnailView: NSStackView {
|
|||||||
highlightOrNot()
|
highlightOrNot()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
showOrHideWindowControls(isHighlighted && mouseIsHovering)
|
showOrHideWindowControls(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
func highlightOrNot() {
|
func highlightOrNot() {
|
||||||
@@ -171,7 +170,6 @@ class ThumbnailView: NSStackView {
|
|||||||
}
|
}
|
||||||
self.mouseUpCallback = { () -> Void in App.app.focusSelectedWindow(element) }
|
self.mouseUpCallback = { () -> Void in App.app.focusSelectedWindow(element) }
|
||||||
self.mouseMovedCallback = { () -> Void in Windows.updateFocusedWindowIndex(index) }
|
self.mouseMovedCallback = { () -> Void in Windows.updateFocusedWindowIndex(index) }
|
||||||
showOrHideWindowControls(false)
|
|
||||||
// force a display to avoid flickering; see https://github.com/lwouis/alt-tab-macos/issues/197
|
// force a display to avoid flickering; see https://github.com/lwouis/alt-tab-macos/issues/197
|
||||||
// quirk: display() should be called last as it resets thumbnail.frame.size somehow
|
// quirk: display() should be called last as it resets thumbnail.frame.size somehow
|
||||||
if labelChanged {
|
if labelChanged {
|
||||||
|
|||||||
@@ -220,19 +220,15 @@ class ScrollView: NSScrollView {
|
|||||||
if let target = target, target is ThumbnailView {
|
if let target = target, target is ThumbnailView {
|
||||||
if previousTarget != target {
|
if previousTarget != target {
|
||||||
previousTarget?.showOrHideWindowControls(false)
|
previousTarget?.showOrHideWindowControls(false)
|
||||||
previousTarget?.mouseIsHovering = false
|
|
||||||
previousTarget = target as? ThumbnailView
|
previousTarget = target as? ThumbnailView
|
||||||
}
|
}
|
||||||
let target = target as! ThumbnailView
|
let target = target as! ThumbnailView
|
||||||
target.mouseMoved()
|
target.mouseMoved()
|
||||||
target.mouseIsHovering = true
|
|
||||||
} else {
|
} else {
|
||||||
previousTarget?.showOrHideWindowControls(false)
|
previousTarget?.showOrHideWindowControls(false)
|
||||||
previousTarget?.mouseIsHovering = false
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
previousTarget?.showOrHideWindowControls(false)
|
previousTarget?.showOrHideWindowControls(false)
|
||||||
previousTarget?.mouseIsHovering = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user