Browse Source

Animating.

pull/113/head
Abhishek Banthia 3 years ago
parent
commit
9500291730
  1. 8
      Clocker/Preferences/Menu Bar/StatusContainerView.swift

8
Clocker/Preferences/Menu Bar/StatusContainerView.swift

@ -177,7 +177,13 @@ class StatusContainerView: NSView {
if newWidth != frame.size.width, newWidth > frame.size.width + 2.0 { if newWidth != frame.size.width, newWidth > frame.size.width + 2.0 {
Logger.info("Correcting our width to \(newWidth) and the previous width was \(frame.size.width)") Logger.info("Correcting our width to \(newWidth) and the previous width was \(frame.size.width)")
frame = CGRect(x: frame.origin.x, y: frame.origin.y, width: newWidth, height: frame.size.height) // NSView move animation
NSAnimationContext.runAnimationGroup({ context in
context.duration = 0.2
let newFrame = CGRect(x: frame.origin.x, y: frame.origin.y, width: newWidth, height: frame.size.height)
// The view will animate to the new origin
self.animator().frame = newFrame
}) {}
} }
} }
} }

Loading…
Cancel
Save