fix: fade-out animation was broken from macos 11 (#760)

This commit is contained in:
Zachary Wander authored and Louis Pontoise committed 2022-06-01 01:22:15 +09:00
1 parent 82e9ca93b6
commit d701bc7347
2 files changed
+12 -4

No files matched your search

+11 -3
View File
@@ -8,7 +8,7 @@ class ThumbnailsPanel: NSPanel, NSWindowDelegate {
self.init(contentRect: .zero, styleMask: .nonactivatingPanel, backing: .buffered, defer: false)
delegate = self
isFloatingPanel = true
updateFadeOutAnimation()
animationBehavior = .none
hidesOnDeactivate = false
hasShadow = false
titleVisibility = .hidden
@@ -35,11 +35,19 @@ class ThumbnailsPanel: NSPanel, NSWindowDelegate {
}
}
func updateFadeOutAnimation() {
animationBehavior = Preferences.fadeOutAnimation ? .utilityWindow : .none
override func orderOut(_ sender: Any?) {
if Preferences.fadeOutAnimation {
NSAnimationContext.runAnimationGroup(
{ _ in animator().alphaValue = 0 },
completionHandler: { super.orderOut(sender) }
)
} else {
super.orderOut(sender)
}
}
func show() {
alphaValue = 1
makeKeyAndOrderFront(nil)
MouseEvents.toggle(true)
thumbnailsView.scrollView.flashScrollers()
@@ -24,7 +24,7 @@ class AppearanceTab {
LabelAndControl.makeLabelWithDropdown(NSLocalizedString("Window title truncation:", comment: ""), "titleTruncation", TitleTruncationPreference.allCases),
LabelAndControl.makeLabelWithDropdown(NSLocalizedString("Show on:", comment: ""), "showOnScreen", ShowOnScreenPreference.allCases),
LabelAndControl.makeLabelWithSlider(NSLocalizedString("Apparition delay:", comment: ""), "windowDisplayDelay", 0, 2000, 11, false, "ms"),
LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Fade out animation:", comment: ""), "fadeOutAnimation", extraAction: { _ in App.app.thumbnailsPanel.updateFadeOutAnimation() }),
LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Fade out animation:", comment: ""), "fadeOutAnimation"),
LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Hide Space number labels:", comment: ""), "hideSpaceNumberLabels"),
LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Hide status icons:", comment: ""), "hideStatusIcons"),
LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Show standard tabs as windows:", comment: ""), "showTabsAsWindows"),