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

Added a VerticalSlider widget. #1596

Merged
merged 4 commits into from
Dec 14, 2022

Conversation

casperstorm
Copy link
Member

@casperstorm casperstorm commented Dec 12, 2022

This PR introduces a VerticalSlider - a duplicate of Slider just vertical.

vertical_slider(0..=100, value, Message::SliderChanged)

I've added an example, which can be run like so: cargo run --package slider

sliders

@hecrj hecrj added this to the 0.7.0 milestone Dec 12, 2022
@hecrj hecrj added feature New feature or request widget layout labels Dec 12, 2022
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.

Cool! Thank you.

I wonder if splitting the new logic completely into a new widget (e.g. VerticalSlider) would be a better approach, since the API guarantees around layout seem to be different between both orientations.

Duplication is not that much of a concern to me :)

@casperstorm
Copy link
Member Author

casperstorm commented Dec 13, 2022

I wonder if splitting the new logic completely into a new widget (e.g. VerticalSlider) would be a better approach, since the API guarantees around layout seem to be different between both orientations.

Sure!

Q: @hecrj do you want VerticalSlider to use Slider appearance or copy it as well? Currently in bb4161c it uses the one from Slider.

@casperstorm casperstorm changed the title Vertical orientation added to Slider. Added a VerticalSlider widget. Dec 13, 2022
@casperstorm casperstorm requested a review from hecrj December 13, 2022 14:44
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.

Awesome! Thanks!

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

Successfully merging this pull request may close these issues.

2 participants