diff --git a/src/ui/main-window/ThumbnailsPanel.swift b/src/ui/main-window/ThumbnailsPanel.swift index cac486be..7ce9b764 100644 --- a/src/ui/main-window/ThumbnailsPanel.swift +++ b/src/ui/main-window/ThumbnailsPanel.swift @@ -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() diff --git a/src/ui/preferences-window/tabs/AppearanceTab.swift b/src/ui/preferences-window/tabs/AppearanceTab.swift index 4076a0b6..3c92753e 100644 --- a/src/ui/preferences-window/tabs/AppearanceTab.swift +++ b/src/ui/preferences-window/tabs/AppearanceTab.swift @@ -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"),