-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
Add non-uniform segment sizing switch #47
Conversation
Good idea. Can you update the readme too? Maybe include the above comparison table and mention when you would use each style. |
@@ -1,6 +1,11 @@ | |||
import Cocoa | |||
|
|||
public enum PreferencesStyle { | |||
public enum SegmentSize { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc comment?
case toolbarItems | ||
case segmentedControl | ||
case segmentedControl(size: SegmentSize) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it technically only the width that changes? Maybe it should be:
case segmentedControl(size: SegmentSize) | |
case segmentedControl(width: SegmentWidth) |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, if we decide to go for shrinking the text too, as mentioned in #47 (comment), size
does make sense.
@@ -1,6 +1,11 @@ | |||
import Cocoa | |||
|
|||
public enum PreferencesStyle { | |||
public enum SegmentSize { | |||
case fit | |||
case uniform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the .fitSmall
idea!
Recently, I've been thinking that we maybe should drop the .uniform
size completely. I don't know if anyone actually prefers uniform sizes. 🤔
But if someone really cares about uniform sizes, I'd like to think that they won't like the segment to change style to .fit
for some of the tabs, and .uniform
for others. The "right thing" here, in my opinion, would be to not encourage sloppy preference windows where the segments jiggle around when you switch the active page.
@sindresorhus WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recently, I've been thinking that we maybe should drop the .uniform size completely. I don't know if anyone actually prefers uniform sizes. 🤔
I like the uniform style and I don't think we should get rid of it. It looks better than "fit" when there are just a few buttons. For example, in one of my apps, I use uniform style:
But if someone really cares about uniform sizes, I'd like to think that they won't like the segment to change style to .fit for some of the tabs, and .uniform for others. The "right thing" here, in my opinion, would be to not encourage sloppy preference windows where the segments jiggle around when you switch the active page.
Good point. Forgot about my idea about "auto". I didn't consider panes having different size.
@DivineDominion Friendly bump. In case you missed my comments :) |
I increased the required Xcode version as I thought that Xcode version was required to compile the latest Swift syntax. I've tried decreasing it here: c79a490 Not sure you'll be able to compile though. |
I won't have time to work on app components until much later this year. What's your plan with this going forward? |
I moved it to an issue in case anyone else wants to work on it sooner: #62 |
This changes
PreferencesStyle.segmentedControl
to get an associated value:With that, you can opt in to not use the widest segmented control size for all segments. I still think the uniform sizing looks best for 2 or 3 segments. But when you have more than 4 panes, the names and large insets become a problem and require very wide windows.