-
-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect animation for first transition to preference pane with different width #60
Comments
I'm having exactly the same issue here. Only with me it's happening with different heights. |
I was able to make it a little bit less annoying by adding a fade animation when moving between panes. It doesn't completely fix the issue you can still notice the jump if you're looking for it, but this anmiation made the jump somewhat less obvious. override func viewWillAppear() {
super.viewWillAppear()
self.view.subviews.first?.alphaValue = 0
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(300)) {
self.view.subviews.first?.animator().alphaValue = 1
}
}
override func viewWillDisappear() {
super.viewWillDisappear()
self.view.subviews.first?.animator().alphaValue = 0
} |
Just want to echo that I'm also having this issue as of 2021-02-17. This is also the same as #59. |
I think you can make a workaround: func fixFirstTimeLanuchOddAnimationByImplicitlyShowIt() {
preferencesWindowController.show(preferencePane: .general)
preferencesWindowController.show(preferencePane: .advanced)
preferencesWindowController.show(preferencePane: .accounts)
preferencesWindowController.close()
} then call it in |
@gaozhanting Nice, this works! Any idea why it works? |
Because the odd animation only happens the first time you opened the tab which you integrate it with SwiftUI view. With this way, it already done immediately after app lanuched, only that user can't see it again afterward. |
Co-authored-by: Sindre Sorhus <[email protected]>
Co-authored-by: Sindre Sorhus <[email protected]>
fix the issue sindresorhus#60
When animating to a preference pane that has not been loaded before and has a larger width than the current pane the view is not correctly laid out initially, which causes an odd animation. The animation is correct in subsequent switches.
The example below is the example app with the width = 450 constraint removed from the Advanced tab, and the app set to open to the Advanced tab.
I'm trying to figure out the exact scenarios that causes this. Starting on Accounts does not cause this same animation to happen so I'm not sure how the size change and animations are linked.
The text was updated successfully, but these errors were encountered: