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

Custom Ticks #9

Closed
wants to merge 35 commits into from
Closed

Custom Ticks #9

wants to merge 35 commits into from

Conversation

thejeff77
Copy link

Added custom ticks to the HUMSlider.

Added various option parameters to enhance the customization potential for the slider.

@thejeff77
Copy link
Author

I've fixed the track width issue we talked about. Currently passing in a Tick with a 0 value will inset the tick from the left enough so that it is in the center of the thumb image, which is about 15px from left by default. I was wondering if I should provide an option to disable inlay of the tick by the radius of the thumb image, and decided to be agile and maybe wait until someone asked for that. This is working fantastically now. It would probably be super easy to modify the previous code to use the new shorter layout methods for odd or evenly spaced ticks. I'll be opening later PRs to add a color to the tick itself so that the default color can be overridden on a tick by tick basis.

Jeffrey Blayney and others added 7 commits March 5, 2018 13:07
Fixed a bug where the custom thumb adjustment value being positive should pop the tick up higher instead of the inverse, because the differentials are more negative the higher they pop up.
static CGFloat const HUMTickWidth = 1;

// Default Constants
static CGFloat const DefaultThumbPxWidth = 30; //Size of apple's default thumb icon.
static CGFloat const DefaultThumbPxWidth = 31; //Size of apple's default thumb icon.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this can be removed

@thejeff77 thejeff77 closed this Jul 2, 2018
@designatednerd
Copy link
Member

@thejeff77 Mind if I reopen this? Was planning on getting you more feedback this weekend or next week

@thejeff77
Copy link
Author

No problem, I have a tricky bug to fix, and realized I have quite a bit of cleanup to do. I'm working on this more today, and can re-open as soon as the code looks a little better. I hope that works! I did a major refactor & am making sure all of the old and new functionality works together. I could never have done this without the code there in the first place to use as an example. Thanks :)

@designatednerd
Copy link
Member

Awesome! Ping me when it's up and I'll take a look

@thejeff77
Copy link
Author

thejeff77 commented Jul 5, 2018

All done. Much better now. Pretty much re-factored how the consistently spaced tick marks worked - it no longer requires an odd number. It didn't make sense to have two separate implementations in there - one for custom ticks the other for consistently spaced ticks. Also added a feature that hugs the tick to the outside of the slider as it moves by - this is cool when the slider is moving slowly for playback type stuff. Added some public properties for more control over how the slider looks when dragged / not dragged. More specifically - one var to keep them from disappearing when the user isn't touching the slider. Another one to prevent them from being lowered while the slider isn't being dragged. Also removed the copyright, as this causes issues with open source review boards and can be perceived as a conflict with an open source MIT license.

@thejeff77
Copy link
Author

@designatednerd this is ready for a review.

@thejeff77 thejeff77 closed this Sep 21, 2018
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

Successfully merging this pull request may close these issues.

2 participants