From 21a5a00cd18d72c30419abd931b584d671dadbd7 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Fri, 1 Feb 2019 20:26:40 -0800 Subject: [PATCH] Moving some work from my laptop to my iMac. --- NetNewsWire/Base.lproj/MainWindow.storyboard | 50 +++++++------------ .../Sidebar/SidebarStatusBarView.swift | 18 +++++-- 2 files changed, 32 insertions(+), 36 deletions(-) diff --git a/NetNewsWire/Base.lproj/MainWindow.storyboard b/NetNewsWire/Base.lproj/MainWindow.storyboard index bc37540ac..5832878c7 100644 --- a/NetNewsWire/Base.lproj/MainWindow.storyboard +++ b/NetNewsWire/Base.lproj/MainWindow.storyboard @@ -258,18 +258,18 @@ - + - + - + - + @@ -355,36 +355,19 @@ - + - - - - - - - - - - - - - - - - - + + + + + - - - - + + + + @@ -410,7 +395,7 @@ - + @@ -629,7 +614,6 @@ - diff --git a/NetNewsWire/MainWindow/Sidebar/SidebarStatusBarView.swift b/NetNewsWire/MainWindow/Sidebar/SidebarStatusBarView.swift index 9d9972903..3d378785b 100644 --- a/NetNewsWire/MainWindow/Sidebar/SidebarStatusBarView.swift +++ b/NetNewsWire/MainWindow/Sidebar/SidebarStatusBarView.swift @@ -16,7 +16,8 @@ final class SidebarStatusBarView: NSView { @IBOutlet var progressIndicator: NSProgressIndicator! @IBOutlet var progressLabel: NSTextField! - + @IBOutlet var heightConstraint: NSLayoutConstraint! + private var isAnimatingProgress = false { didSet { progressIndicator.isHidden = !isAnimatingProgress @@ -74,9 +75,19 @@ private extension SidebarStatusBarView { return } - progressIndicator.stopAnimation(self) isAnimatingProgress = false - progressIndicator.needsDisplay = true +// progressIndicator.needsDisplay = true + + superview?.layoutSubtreeIfNeeded() + + NSAnimationContext.runAnimationGroup({ (context) in + context.duration = 0.2 + context.allowsImplicitAnimation = true + heightConstraint.constant = 0 + superview?.layoutSubtreeIfNeeded() + }) { + progressIndicator.stopAnimation(self) + } } func startProgressIfNeeded() { @@ -86,6 +97,7 @@ private extension SidebarStatusBarView { } isAnimatingProgress = true progressIndicator.startAnimation(self) + heightConstraint.constant = 28 } func updateProgressIndicator(_ progress: CombinedRefreshProgress) {