sindresorhus / Settings

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

The preferences window always opens on the right side of the monitor #22

Closed sindresorhus closed 5 years ago

sindresorhus commented 5 years ago

Issuehunt badges

Screen Shot 2019-04-07 at 18 25 47

Even if I move it and close the window, the next time it opens in the same position.

I think it should open in the center the first time, and then remember the user's position from there. I think we need to use saveFrame(usingName:).


IssueHunt Summary #### [mortennn mortennn](https://issuehunt.io/u/mortennn) has been rewarded. ### Backers (Total: $60.00) - [issuehunt issuehunt](https://issuehunt.io/u/issuehunt) ($60.00) ### Submitted pull Requests - [#33 Fix window-restoration (PR #27)](https://issuehunt.io/r/sindresorhus/Preferences/pull/33) --- ### Tips - Checkout the [Issuehunt explorer](https://issuehunt.io/r/sindresorhus/Preferences/) to discover more funded issues. - Need some help from other developers? [Add your repositories](https://issuehunt.io/r/new) on IssueHunt to raise funds. --- IssueHunt has been backed by the following sponsors. [Become a sponsor](https://issuehunt.io/membership/members)
IssueHuntBot commented 5 years ago

@issuehunt has funded $60.00 to this issue.


DivineDominion commented 5 years ago

I looked into this. This appears to be 2 things: first, restore the window position. Second, window.center() doesn't center on your device. I added #27 to work on the first part, but the 2nd issue is strange. Can you see what happens if you create a vanilla Cocoa app and call center() on the main window? Maybe center on user interaction with a button? (Because IB sometimes puts the windows at the center correctly already)

DivineDominion commented 5 years ago

@sindresorhus Was this solved through #33 on your machine, too?

sindresorhus commented 5 years ago

33 fixes it.

issuehunt-oss[bot] commented 5 years ago

@sindresorhus has rewarded $54.00 to @mortennn. See it on IssueHunt