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

Add border_radius to slider rail #1892

Merged
merged 4 commits into from
Jun 1, 2023

Conversation

casperstorm
Copy link
Member

This small PR adds the ability to adjust the border radius for the slider rail.
I also updated the default colors of the rail slightly so it use two different colors rather than just one.

Screenshot 2023-06-01 at 10 46 05

Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

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

Looks good!

Can we make those sliders the default styling too? They look nice.

@hecrj
Copy link
Member

hecrj commented Jun 1, 2023

Changed it myself!

I also fixed this rendering issue in 66d4dec:

image

Apparently, our quad pipeline doesn't produce the best result when only some borders are being rounded.

@hecrj hecrj enabled auto-merge June 1, 2023 15:30
@hecrj hecrj added feature New feature or request widget styling labels Jun 1, 2023
@hecrj hecrj added this to the 0.10.0 milestone Jun 1, 2023
@hecrj hecrj merged commit b353767 into iced-rs:master Jun 1, 2023
@casperstorm
Copy link
Member Author

casperstorm commented Jun 1, 2023

Changed it myself!

I also fixed this rendering issue in 66d4dec:

image

Apparently, our quad pipeline doesn't produce the best result when only some borders are being rounded.

Small problem with 66d4dec is if the handle is very slim, say 1px. Then you see the rounding in the middle where the rectangles meet.

@bungoboingo
Copy link
Contributor

I think if quad width is <= 2.0 we should not try to do a border radius, just use the normal quad border algorithm; border-radius of like 5 with a quad width of 2 doesn't make sense imo. Maybe just if quad width < border radius we render as a normal squared border? Or progressively shrink it until it's < 2.0 (in which case there will only be 1 px available for each corner)?

@hecrj
Copy link
Member

hecrj commented Jun 1, 2023

@casperstorm Let's see how common that is. Maybe by the time someone complains we have already fixed the quad glitches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request styling widget
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants