Skip to content

Configurable width for Scrollable#1749

Merged
hecrj merged 2 commits intoiced-rs:masterfrom
NoraPerry:fix/add-width-to-scrollable
Apr 12, 2023
Merged

Configurable width for Scrollable#1749
hecrj merged 2 commits intoiced-rs:masterfrom
NoraPerry:fix/add-width-to-scrollable

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

Comments