Skip to content
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

Provide a Preferences… menu item #14

Open
sindresorhus opened this issue Apr 2, 2019 · 3 comments
Open

Provide a Preferences… menu item #14

sindresorhus opened this issue Apr 2, 2019 · 3 comments
Labels
💵 Funded on Issuehunt This issue has been funded on Issuehunt enhancement New feature or request help wanted Extra attention is needed

Comments

@sindresorhus
Copy link
Owner

sindresorhus commented Apr 2, 2019

Issuehunt badges

Would be useful if we provide a default Preferences… menu that opens the preferences window. Can be programmatically created or subclassed in Interface Builder. Should also include localization.

If the app is a menu bar app, we should also call NSApp.activate(ignoringOtherApps: true) before showing the Preferences window.

There is a $80.00 open bounty on this issue. Add more on Issuehunt.

@sindresorhus sindresorhus added enhancement New feature or request help wanted Extra attention is needed labels Apr 2, 2019
@DivineDominion
Copy link
Collaborator

Cocoa app templates include a default item already, albeit without an action:

Screenshot 2019-04-03 at 08 26 07

The "pluggable" options that don't require much from devs I see could be:

  • require an @IBAction e.g. in the AppDelegate like the about window does with FirstResponder.orderFrontStandardAboutPanel(_:);
  • provide a singleton helper object like Sparkle's SUUpdater that people can put into interface builder and wire the showPreferencesWindow(_:) to;
  • provide a NSMenuItem subclass devs have to change the IB default to that provides a default action/target mechanism

I think the last one is rather clumsy compared to the first two. The other options appear to be more similar to existing conventions.

@sindresorhus
Copy link
Owner Author

Cocoa app templates include a default item already, albeit without an action:

Yup, but the default item is also missing localization.

provide a NSMenuItem subclass devs have to change the IB default to that provides a default action/target mechanism

Yes, that's what I meant. I use this method for many utility subclasses in my apps with great success. For example, I have a UrlMenuItem to easily open an URL when certain menu items are clicked. I personally dread @IBAction and outlets in general.

I think the last one is rather clumsy compared to the first two. The other options appear to be more similar to existing conventions.

I find the object helper thing for Sparkle super awkward. The class dropdown is IMHO very easy to use.

@IssueHuntBot
Copy link

@IssueHunt has funded $80.00 to this issue.


@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💵 Funded on Issuehunt This issue has been funded on Issuehunt enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants