sindresorhus / Settings

⚙ Add a settings window to your macOS app in minutes
MIT License
1.45k stars 101 forks source link

fix unexpected switching animation #100

Closed metacodes closed 1 year ago

metacodes commented 1 year ago

fixes #60 fixes #59

sindresorhus commented 1 year ago

Thanks for working on this.

I'm still seeing the animation problem when I start on the "Accounts" tab in the Example app and then switch to the "General" tab.

metacodes commented 1 year ago

Thanks for working on this.

I'm still seeing the animation problem when I start on the "Accounts" tab in the Example app and then switch to the "General" tab.

You can reproduce this issue by starting on "General" tab and then switch to "Accounts" tab. If you set translatesAutoresizingMaskIntoConstraints to be false, then the animation will work correctly.(Tested on macOS 13.2.1)

sindresorhus commented 1 year ago

Thanks ;)

DivineDominion commented 1 year ago

I wonder if

a) this may be too intrusive? If the view was assembled from code, this might already be false; but if it's from IB, could this break things? b) we should add a comment above the new line to explain why this is needed?

metacodes commented 1 year ago

I wonder if

a) this may be too intrusive? If the view was assembled from code, this might already be false; but if it's from IB, could this break things? b) we should add a comment above the new line to explain why this is needed?

By default, the property is set to true for any view you programmatically create. If you add views in Interface Builder, the system automatically sets this property to false.https://developer.apple.com/documentation/uikit/uiview/1622572-translatesautoresizingmaskintoco

Although it's UIView, but it seems the same to NSView.