sindresorhus / Settings

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

Is it possible to add a flexible space between toolbar icons? #50

Closed fracturedsoftware closed 4 years ago

fracturedsoftware commented 4 years ago

I have a need to add a 'Revert' item to my preferences toolbar. I would like this item to be placed on the right of the toolbar with a flexible space between it and the other items. The flexible space pushes the item all the way to the right. I don't see an obvious way to do this in your framework. Is it possible?

Thanks!

sindresorhus commented 4 years ago

Just curious, what would the Revert item do? Is it a button with an action or does it show another pane? If a pane, what would the pane contain?

fracturedsoftware commented 4 years ago

Hi Sindre,

Sorry for taking so long to get back to you.

I have included a small image of a Preference panel in an old app of mine. The idea is to be able to completely reset the preferences, or in some cases have a list of the panels with a checkbox next to them, so that you can just reset some preferences. This revert/reset idea used to be quite common but its be a while since I looked - an of course it would be possible to do it a different way as well.

In my app above I used another framework for the preferences - DBPrefs. The Toolbar spacer was created using an NSToolbarSpaceItemIdentifier.

Hope that helps and thank you for the framework!

Regards,

Peter

On 9 May 2020, at 5:35 pm, Sindre Sorhus notifications@github.com wrote:

Just curious, what would the Revert item do? Is it a button with an action or does it show another pane? If a pane, what would the pane contain?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sindresorhus/Preferences/issues/50#issuecomment-626122499, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIM5O6TPQS6355SZLZDNU4TRQUBT5ANCNFSM4M4T4YWA.

-- Email domain proudly hosted at https://migadu.com

sindresorhus commented 4 years ago

Thanks for elaborating.

The idea is to be able to completely reset the preferences, or in some cases have a list of the panels with a checkbox next to them, so that you can just reset some preferences.

You should generally not have "reset"-type button. But if you do, it should be in the context of where the preferences are set, meaning a button in the relevant pane, not in a separate "Reset" pane.


I'm lukewarm on adding support for a spacer. Spacers are often used in preferences windows when they are not needed. None of Apple's apps use a spacer in their preferences panes (AFAIK).

I'll keep this open for more opinions.

phucledien commented 4 years ago

+1 for Spacer. In my case, I would use it for separating the About pane :D. Like this one in CleanShot X application

image

sindresorhus commented 4 years ago

I think that is an anti-pattern and also against the macOS Human Interface Guidelines. "About" has nothing to do with preferences. "About" should be in a separate window.

sindresorhus commented 4 years ago

I'm going to pass on this, since on macOS 11, all the icons are supposed to be centered, so this is moot there.