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

Click on slider track should adjust value #37

Closed
thompsonate opened this issue Jun 8, 2021 · 2 comments
Closed

Click on slider track should adjust value #37

thompsonate opened this issue Jun 8, 2021 · 2 comments
Assignees

Comments

@thompsonate
Copy link

With NSSlider on macOS, you can click on the slider track to move the thumb to the clicked position. When running on macOS, these sliders should do the same.

@ay42 ay42 self-assigned this Oct 2, 2021
@ay42
Copy link
Member

ay42 commented Oct 2, 2021

Hi @thompsonate,
This option interactiveTrack is disabled by default. Here is an example on how to enable it.

ValueSlider(value: $value4)
    .valueSliderStyle(
        HorizontalValueSliderStyle(
            track: LinearGradient(
                gradient: Gradient(colors: [.purple, .blue, .purple]),
                startPoint: .leading,
                endPoint: .trailing
            )
            .frame(height: 6)
            .cornerRadius(3),
            thumbSize: CGSize(width: 48, height: 16),
            options: .interactiveTrack
        )
    )

@ay42 ay42 closed this as completed Oct 2, 2021
@thompsonate
Copy link
Author

This works great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants