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

Configurable width for Scrollable #1749

Merged
merged 2 commits into from
Apr 12, 2023

Conversation

NoraPerry
Copy link
Contributor

Fix #1704.

Add width to scrollables so you can do stuff like .width(Length::Fill) to make the scroll bar appear on the edge of the screen, previously as far as I'm aware you had to set the width of the scrollables child element instead.

I've tested by running the scrollable example project and my own project which uses a scrollable and it appears to work correctly with no unexpected side effects but I'm not sure if there is a more rigorous way to test these changes.

@hecrj hecrj added feature New feature or request widget labels Apr 12, 2023
@hecrj hecrj added this to the 0.9.0 milestone Apr 12, 2023
@hecrj
Copy link
Member

hecrj commented Apr 12, 2023

I believe we should strive for widgets to have very specialized purposes and have fewer responsibilities in the long run.

If this behavior can already be achieved with a container with width(Length::Fill) as the child of the scrollable, then let's keep it that way! No need to have many different ways to achieve the same thing.

@hecrj hecrj closed this Apr 12, 2023
@hecrj hecrj reopened this Apr 12, 2023
@hecrj
Copy link
Member

hecrj commented Apr 12, 2023

I forgot that scrollables now can scroll horizontally as well! A width attribute makes sense then.

@hecrj hecrj changed the title Add width to scrollables Add width to Scrollable Apr 12, 2023
@hecrj hecrj changed the title Add width to Scrollable Configurable width for Scrollable Apr 12, 2023
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 great! Thanks 🙇

@hecrj hecrj enabled auto-merge April 12, 2023 21:44
@hecrj hecrj merged commit 1de7da1 into iced-rs:master Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request widget
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scrollable supports height but not width
2 participants