-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Update the RangeSlider
widget to the 2024 Material Design appearance
#163736
base: master
Are you sure you want to change the base?
Conversation
0d2efdc
to
04e0d7e
Compare
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.
Thanks so much for adding the new M3 style for RangeSlider! I just did the first round review and it looks really great!
if (_active && thumbWidth != null && pressedThumbWidth != null && trackGap != null) { | ||
delta = thumbWidth - pressedThumbWidth; | ||
if (thumbWidth > 0.0) { | ||
thumbWidth = pressedThumbWidth; |
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.
When thumbWidth
is > 0, thumbWidth equals to pressedThumbWidth, but is it possible that thumbWidth is <= 0?
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.
Good question! The thumb shape actually renders the thumb with a non-negative size when passing a negative thumbWidth
. For instance, passing -10
will render a thumb shape with a width of 10 pixels.
As a result, the thumbWidth > 0.0
condition actually ignores the pressed width. We don't need this condition since the thumb renders just fine with a negative width, and it should have a pressed width as well. I'll remove this condition.
04e0d7e
to
3749d09
Compare
Fixes Update
RangeSlider
for Material 3 redesignDescription
This PR updates
RangeSlider
withyear2023
flag which can be used to opt into the 2024 `RangeSlider design appearance.Code Sample
expand to view the code sample
Custom track gap and thumb size
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.