diff --git a/docs/Contributors.md b/docs/Contributors.md index 32e6512b..10b7cf2d 100644 --- a/docs/Contributors.md +++ b/docs/Contributors.md @@ -74,6 +74,7 @@ They helped [localize the app](https://poeditor.com/join/project/8AOEZ0eAZE): * Jaeyong Sung * Jakob * Jakub BartuĊĦek +* john doe * Jord Nijhuis * Julian Nowaczyk * Kagurazaka Tsuki diff --git a/src/ui/main-window/ThumbnailView.swift b/src/ui/main-window/ThumbnailView.swift index 3d9823b1..a014fa51 100644 --- a/src/ui/main-window/ThumbnailView.swift +++ b/src/ui/main-window/ThumbnailView.swift @@ -23,6 +23,7 @@ class ThumbnailView: NSStackView { var shouldShowWindowControls = false var isShowingWindowControls = false var windowlessIcon = FontIcon(.newWindow) + var mouseIsHovering = false // for VoiceOver cursor override var canBecomeKeyView: Bool { true } @@ -66,11 +67,9 @@ class ThumbnailView: NSStackView { [closeIcon, minimizeIcon, maximizeIcon].forEach { $0.isHidden = true } } - func showOrHideWindowControls(_ shouldShowWindowControls_: Bool? = nil) { - if let shouldShowWindowControls = shouldShowWindowControls_ { - self.shouldShowWindowControls = shouldShowWindowControls - } - let shouldShow = shouldShowWindowControls && !Preferences.hideColoredCircles && !window_!.isWindowlessApp && !Preferences.hideThumbnails + func showOrHideWindowControls(_ shouldShowWindowControls: Bool) { + self.shouldShowWindowControls = shouldShowWindowControls + let shouldShow = shouldShowWindowControls && !Preferences.hideColoredCircles && !(window_?.isWindowlessApp ?? true) && !Preferences.hideThumbnails if isShowingWindowControls != shouldShow { isShowingWindowControls = shouldShow [closeIcon, minimizeIcon, maximizeIcon].forEach { $0.isHidden = !shouldShow } @@ -92,7 +91,7 @@ class ThumbnailView: NSStackView { highlightOrNot() } } - showOrHideWindowControls() + showOrHideWindowControls(isHighlighted && mouseIsHovering) } func highlightOrNot() { diff --git a/src/ui/main-window/ThumbnailsView.swift b/src/ui/main-window/ThumbnailsView.swift index 32d2875b..6e894552 100644 --- a/src/ui/main-window/ThumbnailsView.swift +++ b/src/ui/main-window/ThumbnailsView.swift @@ -220,14 +220,19 @@ class ScrollView: NSScrollView { if let target = target, target is ThumbnailView { if previousTarget != target { previousTarget?.showOrHideWindowControls(false) + previousTarget?.mouseIsHovering = false previousTarget = target as? ThumbnailView } - (target as! ThumbnailView).mouseMoved() + let target = target as! ThumbnailView + target.mouseMoved() + target.mouseIsHovering = true } else { previousTarget?.showOrHideWindowControls(false) + previousTarget?.mouseIsHovering = false } } else { previousTarget?.showOrHideWindowControls(false) + previousTarget?.mouseIsHovering = false } }